From 633935a11989f3922bfd6985d5edff3713fbae8f Mon Sep 17 00:00:00 2001 From: Dora Militaru Date: Tue, 24 Oct 2023 15:35:30 +0100 Subject: [PATCH 1/2] Rename Compute@Edge to Compute --- README.md | 10 +++++----- fastly.toml | 2 +- src/index.ts | 8 ++++---- ...me-to-compute@edge.html => welcome-to-compute.html} | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) rename src/{welcome-to-compute@edge.html => welcome-to-compute.html} (93%) diff --git a/README.md b/README.md index a7823bd..af713ee 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![Deploy to Fastly](https://deploy.edgecompute.app/button)](https://deploy.edgecompute.app/deploy) -Get to know the Fastly Compute@Edge environment with a basic starter that demonstrates routing, simple synthetic responses and code comments that cover common patterns. +Get to know the Fastly Compute environment with a basic starter that demonstrates routing, simple synthetic responses and code comments that cover common patterns. -**For more details about other starter kits for Compute@Edge, see the [Fastly developer hub](https://developer.fastly.com/solutions/starters)** +**For more details about other starter kits for Compute, see the [Fastly developer hub](https://developer.fastly.com/solutions/starters)** ## Features * Allow only requests with particular HTTP methods @@ -13,11 +13,11 @@ Get to know the Fastly Compute@Edge environment with a basic starter that demons ## Understanding the code -This starter is intentionally lightweight, and requires no dependencies aside from the [`@fastly/js-compute`](https://www.npmjs.com/package/@fastly/js-compute) npm package. It will help you understand the basics of processing requests at the edge using Fastly. This starter includes implementations of common patterns explained in our [using Compute@Edge](https://developer.fastly.com/learning/compute/javascript/) and [VCL migration](https://developer.fastly.com/learning/compute/migrate/) guides. +This starter is intentionally lightweight, and requires no dependencies aside from the [`@fastly/js-compute`](https://www.npmjs.com/package/@fastly/js-compute) npm package. It will help you understand the basics of processing requests at the edge using Fastly. This starter includes implementations of common patterns explained in our [using Compute](https://developer.fastly.com/learning/compute/javascript/) and [VCL migration](https://developer.fastly.com/learning/compute/migrate/) guides. -The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute@Edge that can generate synthetic responses at the edge. +The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute that can generate synthetic responses at the edge. -The template uses TypeScript to compile source files in `./src` into JS files in `./build`, which are then wrapped into `./bin/index.wasm` using the `js-compute-runtime` CLI tool bundled with the `@fastly/js-compute` npm package, and bundled into a `.tar.gz` file ready for deployment to Compute@Edge. +The template uses TypeScript to compile source files in `./src` into JS files in `./build`, which are then wrapped into `./bin/index.wasm` using the `js-compute-runtime` CLI tool bundled with the `@fastly/js-compute` npm package, and bundled into a `.tar.gz` file ready for deployment to Compute. ## Security issues diff --git a/fastly.toml b/fastly.toml index 50d84a3..53c3797 100644 --- a/fastly.toml +++ b/fastly.toml @@ -1,4 +1,4 @@ -# This file describes a Fastly Compute@Edge package. To learn more visit: +# This file describes a Fastly Compute package. To learn more visit: # https://developer.fastly.com/reference/fastly-toml/ authors = [""] diff --git a/src/index.ts b/src/index.ts index 277824a..5fa08e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -//! Default Compute@Edge template program. +//! Default Compute template program. /// // import { CacheOverride } from "fastly:cache-override"; @@ -8,7 +8,7 @@ import { includeBytes } from "fastly:experimental"; // Load a static file as a Uint8Array at compile time. // File path is relative to root of project, not to this file -const welcomePage = includeBytes("./src/welcome-to-compute@edge.html"); +const welcomePage = includeBytes("./src/welcome-to-compute.html"); // The entry point for your application. // @@ -37,14 +37,14 @@ async function handleRequest(event: FetchEvent) { // If request is to the `/` path... if (url.pathname == "/") { - // Below are some common patterns for Compute@Edge services using JavaScript. + // Below are some common patterns for Fastly Compute services using JavaScript. // Head to https://developer.fastly.com/learning/compute/javascript/ to discover more. // Create a new request. // let bereq = new Request("http://example.com"); // Add request headers. - // req.headers.set("X-Custom-Header", "Welcome to Compute@Edge!"); + // req.headers.set("X-Custom-Header", "Welcome to Fastly Compute!"); // req.headers.set( // "X-Another-Custom-Header", // "Recommended reading: https://developer.fastly.com/learning/compute" diff --git a/src/welcome-to-compute@edge.html b/src/welcome-to-compute.html similarity index 93% rename from src/welcome-to-compute@edge.html rename to src/welcome-to-compute.html index 7a3761b..cc18336 100644 --- a/src/welcome-to-compute@edge.html +++ b/src/welcome-to-compute.html @@ -7,7 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> - Welcome to Compute@Edge + Welcome to Fastly Compute Date: Tue, 24 Oct 2023 15:36:52 +0100 Subject: [PATCH 2/2] bump dependencies --- package-lock.json | 33 +++++++++++++++------------------ package.json | 4 ++-- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0661e4b..ef8496f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,14 +5,11 @@ "requires": true, "packages": { "": { - "name": "compute-starter-kit-typescript", - "version": "0.2.0", - "license": "MIT", "dependencies": { - "@fastly/js-compute": "^3.4.0" + "@fastly/js-compute": "^3.7.0" }, "devDependencies": { - "typescript": "^5.0.2" + "typescript": "^5.2.2" }, "engines": { "node": "^16 || >=18" @@ -485,9 +482,9 @@ } }, "node_modules/@fastly/js-compute": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@fastly/js-compute/-/js-compute-3.4.0.tgz", - "integrity": "sha512-YpwyDebWKV0CWlmG4GrILw7qreErpyls7H71mofQmZaeoL2RkXeDZnCVyG4gOc7lW2rUtYd9TWis8Ias/uJB+A==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@fastly/js-compute/-/js-compute-3.7.0.tgz", + "integrity": "sha512-36aCipSW5kWNUmJ3aTWLWayzfPKwtRQZRVBImURdfR8+7wlmkq5VQlBpy7W72b6WaC7wnkfqVjUOMrsAtaVpIg==", "dependencies": { "@bytecodealliance/jco": "^0.10.0", "@bytecodealliance/wizer": "^3.0.1", @@ -1147,16 +1144,16 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/typescript": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", - "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/unicode-canonical-property-names-ecmascript": { @@ -1416,9 +1413,9 @@ "optional": true }, "@fastly/js-compute": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@fastly/js-compute/-/js-compute-3.4.0.tgz", - "integrity": "sha512-YpwyDebWKV0CWlmG4GrILw7qreErpyls7H71mofQmZaeoL2RkXeDZnCVyG4gOc7lW2rUtYd9TWis8Ias/uJB+A==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@fastly/js-compute/-/js-compute-3.7.0.tgz", + "integrity": "sha512-36aCipSW5kWNUmJ3aTWLWayzfPKwtRQZRVBImURdfR8+7wlmkq5VQlBpy7W72b6WaC7wnkfqVjUOMrsAtaVpIg==", "requires": { "@bytecodealliance/jco": "^0.10.0", "@bytecodealliance/wizer": "^3.0.1", @@ -1842,9 +1839,9 @@ } }, "typescript": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", - "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true }, "unicode-canonical-property-names-ecmascript": { diff --git a/package.json b/package.json index dcb5d8f..582c305 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "node": "^16 || >=18" }, "devDependencies": { - "typescript": "^5.0.2" + "typescript": "^5.2.2" }, "dependencies": { - "@fastly/js-compute": "^3.4.0" + "@fastly/js-compute": "^3.7.0" }, "scripts": { "prebuild": "tsc",