From b52e21b3482cab89595b0a08a05fc08bfae08896 Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 16:32:32 +0000 Subject: [PATCH 01/10] remove module type and shrinkwrap all optional wizer --- npm-shrinkwrap.json | 19 +++++++++++++++++++ package.json | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ae8746e..ee289cc 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2025,12 +2025,31 @@ "@jakechampion/wizer-win32-x64": "1.6.0" } }, + "node_modules/@jakechampion/wizer-darwin-arm64": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jakechampion/wizer-darwin-arm64/-/wizer-darwin-arm64-1.6.0.tgz", + "integrity": "sha512-bQdIPdR+Ye0GiNdirVhx0kx14oY2uzwXfh/2dDgteBdcb7mDubzKbdt3ROMyV1UFRVhOtqbthZNk7qLBB6Occg==", + "optional": true + }, "@jakechampion/wizer-darwin-x64": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jakechampion/wizer-darwin-x64/-/wizer-darwin-x64-1.6.0.tgz", "integrity": "sha512-b+hdpZbhilsroSJU4Z2t+qj9lz3lr3M0TTyM8vlHODP0j8ZabZwPM8314wuSdSrHM5fZ9qIAO2Q94AUBBOeuRA==", "optional": true }, + "@jakechampion/wizer-linux-x64": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jakechampion/wizer-linux-x64/-/wizer-linux-x64-1.6.0.tgz", + "integrity": "sha512-nOH/wwoN/jaLYBKyCnEQJtqEOrSuXMOWIdnh/vAp5w4sFXuyelyZY0k6g9b8puzLOyXJTrUoYfhHyf2vdLGlxQ==", + "optional": true + }, + "node_modules/@jakechampion/wizer-win32-x64": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jakechampion/wizer-win32-x64/-/wizer-win32-x64-1.6.0.tgz", + "integrity": "sha512-9xzpraJIhLdOnXTC1DjxjyfV52BBlAZTTAlpnE04GxVRvRGZ6wPi/RdACkg3inAfeTP7A/bTq3BJLql/Hansdw==", + "cpu": ["x64"], + "optional": true + }, "@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", diff --git a/package.json b/package.json index 5e70177..3461603 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "type": "git", "url": "git+https://github.com/fastly/compute-starter-kit-javascript-default.git" }, - "type": "module", "author": "oss@fastly.com", "license": "MIT", "bugs": { From 282c98d717f58d548abd202d8c93e2787135ea55 Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:13:07 +0000 Subject: [PATCH 02/10] use imports in webpack config --- fastly.toml | 13 ++++++++++--- npm-shrinkwrap.json | 13 ------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/fastly.toml b/fastly.toml index bd6c821..8c5c283 100644 --- a/fastly.toml +++ b/fastly.toml @@ -1,5 +1,12 @@ -manifest_version = 2 -name = "Default starter for JavaScript" -description = "A basic starter kit that demonstrates routing, simple synthetic responses and overriding caching rules." +# This file describes a Fastly Compute@Edge package. To learn more visit: +# https://developer.fastly.com/reference/fastly-toml/ + authors = [""] +description = "A basic starter kit that demonstrates routing, simple synthetic responses and overriding caching rules." language = "javascript" +manifest_version = 2 +name = "Default starter for JavaScript" +service_id = "" + +[scripts] + build = "npm exec webpack && npm exec js-compute-runtime ./bin/index.js ./bin/main.wasm" diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ee289cc..926b51c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2025,12 +2025,6 @@ "@jakechampion/wizer-win32-x64": "1.6.0" } }, - "node_modules/@jakechampion/wizer-darwin-arm64": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@jakechampion/wizer-darwin-arm64/-/wizer-darwin-arm64-1.6.0.tgz", - "integrity": "sha512-bQdIPdR+Ye0GiNdirVhx0kx14oY2uzwXfh/2dDgteBdcb7mDubzKbdt3ROMyV1UFRVhOtqbthZNk7qLBB6Occg==", - "optional": true - }, "@jakechampion/wizer-darwin-x64": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jakechampion/wizer-darwin-x64/-/wizer-darwin-x64-1.6.0.tgz", @@ -2043,13 +2037,6 @@ "integrity": "sha512-nOH/wwoN/jaLYBKyCnEQJtqEOrSuXMOWIdnh/vAp5w4sFXuyelyZY0k6g9b8puzLOyXJTrUoYfhHyf2vdLGlxQ==", "optional": true }, - "node_modules/@jakechampion/wizer-win32-x64": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@jakechampion/wizer-win32-x64/-/wizer-win32-x64-1.6.0.tgz", - "integrity": "sha512-9xzpraJIhLdOnXTC1DjxjyfV52BBlAZTTAlpnE04GxVRvRGZ6wPi/RdACkg3inAfeTP7A/bTq3BJLql/Hansdw==", - "cpu": ["x64"], - "optional": true - }, "@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", From f87135c78b76441dfbae12f48083573f91e69804 Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:14:40 +0000 Subject: [PATCH 03/10] use imports in webpack config --- package.json | 1 + webpack.config.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3461603..b9dde19 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "compute-starter-kit-javascript-default", "version": "0.4.0", "main": "src/index.js", + "type": "module", "repository": { "type": "git", "url": "git+https://github.com/fastly/compute-starter-kit-javascript-default.git" diff --git a/webpack.config.js b/webpack.config.js index 5c61133..8617bcf 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ -const path = require("path"); -const webpack = require("webpack"); +import * as path from 'path'; +import * as webpack from 'webpack'; module.exports = { entry: "./src/index.js", From 09ac7309186667efda4befeddeb660b1f12ba0c7 Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:15:07 +0000 Subject: [PATCH 04/10] Update fastly.toml --- fastly.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/fastly.toml b/fastly.toml index 8c5c283..6ea64c2 100644 --- a/fastly.toml +++ b/fastly.toml @@ -7,6 +7,3 @@ language = "javascript" manifest_version = 2 name = "Default starter for JavaScript" service_id = "" - -[scripts] - build = "npm exec webpack && npm exec js-compute-runtime ./bin/index.js ./bin/main.wasm" From b8364bc25564023ba21807c5bb299479665ec36f Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:15:20 +0000 Subject: [PATCH 05/10] Update fastly.toml --- fastly.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/fastly.toml b/fastly.toml index 6ea64c2..44bd1da 100644 --- a/fastly.toml +++ b/fastly.toml @@ -6,4 +6,3 @@ description = "A basic starter kit that demonstrates routing, simple synthetic r language = "javascript" manifest_version = 2 name = "Default starter for JavaScript" -service_id = "" From ca40abf6e2b6fba020175374f7745bda00c5d3fe Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:16:24 +0000 Subject: [PATCH 06/10] no changes to fastly.toml --- fastly.toml | 9 +++------ webpack.config.js | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fastly.toml b/fastly.toml index 44bd1da..bd6c821 100644 --- a/fastly.toml +++ b/fastly.toml @@ -1,8 +1,5 @@ -# This file describes a Fastly Compute@Edge package. To learn more visit: -# https://developer.fastly.com/reference/fastly-toml/ - -authors = [""] -description = "A basic starter kit that demonstrates routing, simple synthetic responses and overriding caching rules." -language = "javascript" manifest_version = 2 name = "Default starter for JavaScript" +description = "A basic starter kit that demonstrates routing, simple synthetic responses and overriding caching rules." +authors = [""] +language = "javascript" diff --git a/webpack.config.js b/webpack.config.js index 8617bcf..11ea29d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ -import * as path from 'path'; -import * as webpack from 'webpack'; +import * as path from "path"; +import * as webpack from "webpack"; module.exports = { entry: "./src/index.js", From e56eefb7a96850f4be98a9723a6b168ac7ca8212 Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:25:37 +0000 Subject: [PATCH 07/10] no type module --- package.json | 1 - webpack.config.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b9dde19..3461603 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "compute-starter-kit-javascript-default", "version": "0.4.0", "main": "src/index.js", - "type": "module", "repository": { "type": "git", "url": "git+https://github.com/fastly/compute-starter-kit-javascript-default.git" diff --git a/webpack.config.js b/webpack.config.js index 11ea29d..5c61133 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ -import * as path from "path"; -import * as webpack from "webpack"; +const path = require("path"); +const webpack = require("webpack"); module.exports = { entry: "./src/index.js", From 06da91a76e3ba63f30f3649fd4d7ce67c8b98cdc Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:34:48 +0000 Subject: [PATCH 08/10] use npm build command --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec7cca8..c04171e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,4 +20,4 @@ jobs: ${{ runner.os }}-node- - run: npm ci - name: build - run: npm exec js-compute-runtime ./src/index.js ./bin/main.wasm + run: npm run build From 11998c34c7e05214f3c9fbe93249782cb05b064c Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 17:49:41 +0000 Subject: [PATCH 09/10] Update npm-shrinkwrap.json --- npm-shrinkwrap.json | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 926b51c..656df6f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -64,17 +64,24 @@ "@jakechampion/wizer-win32-x64": "1.6.0" } }, + "node_modules/@jakechampion/wizer-darwin-arm64": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jakechampion/wizer-darwin-arm64/-/wizer-darwin-arm64-1.6.0.tgz", + "integrity": "sha512-bQdIPdR+Ye0GiNdirVhx0kx14oY2uzwXfh/2dDgteBdcb7mDubzKbdt3ROMyV1UFRVhOtqbthZNk7qLBB6Occg==", + "cpu": ["arm64"], + "optional": true, + "os": ["darwin"], + "bin": { + "wizer-darwin-arm64": "wizer" + } + }, "node_modules/@jakechampion/wizer-darwin-x64": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jakechampion/wizer-darwin-x64/-/wizer-darwin-x64-1.6.0.tgz", "integrity": "sha512-b+hdpZbhilsroSJU4Z2t+qj9lz3lr3M0TTyM8vlHODP0j8ZabZwPM8314wuSdSrHM5fZ9qIAO2Q94AUBBOeuRA==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "bin": { "wizer-darwin-x64": "wizer" } @@ -83,17 +90,24 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jakechampion/wizer-linux-x64/-/wizer-linux-x64-1.6.0.tgz", "integrity": "sha512-nOH/wwoN/jaLYBKyCnEQJtqEOrSuXMOWIdnh/vAp5w4sFXuyelyZY0k6g9b8puzLOyXJTrUoYfhHyf2vdLGlxQ==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "bin": { "wizer-linux-x64": "wizer" } }, + "node_modules/@jakechampion/wizer-win32-x64": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jakechampion/wizer-win32-x64/-/wizer-win32-x64-1.6.0.tgz", + "integrity": "sha512-9xzpraJIhLdOnXTC1DjxjyfV52BBlAZTTAlpnE04GxVRvRGZ6wPi/RdACkg3inAfeTP7A/bTq3BJLql/Hansdw==", + "cpu": ["x64"], + "optional": true, + "os": ["win32"], + "bin": { + "wizer-win32-x64": "wizer" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", From 48e1abe00ba1179cd622e8a16c61251aa8e8d02a Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Fri, 3 Feb 2023 18:05:19 +0000 Subject: [PATCH 10/10] update fastly.toml --- fastly.toml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fastly.toml b/fastly.toml index bd6c821..c1acdb4 100644 --- a/fastly.toml +++ b/fastly.toml @@ -1,5 +1,11 @@ -manifest_version = 2 -name = "Default starter for JavaScript" -description = "A basic starter kit that demonstrates routing, simple synthetic responses and overriding caching rules." +# This file describes a Fastly Compute@Edge package. To learn more visit: +# https://developer.fastly.com/reference/fastly-toml/ + authors = [""] +description = "A basic starter kit that demonstrates routing, simple synthetic responses and overriding caching rules." language = "javascript" +manifest_version = 2 +name = "Default starter for JavaScript" + +[scripts] + build = "npm run build"