From d69c79edb75f0bd1cf177c8c2e7fde0d20f923c2 Mon Sep 17 00:00:00 2001 From: Jackie Macharia Date: Wed, 25 May 2022 18:20:47 +0300 Subject: [PATCH 1/2] feat: support for Edge Functions debugging (#31) * feat: add support for Edge Functions debbugging via deno --inspect and --inspect-brk flags --- src/server/server.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/server/server.ts b/src/server/server.ts index 45e5f454..1cd793a3 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -71,10 +71,21 @@ const prepareServer = ({ return startIsolate } +interface InspectSettings { + // Inspect mode enabled + enabled: boolean + + // Pause on breakpoints (i.e. "--brk") + pause: boolean + + // Host/port override (optional) + address?: string +} interface ServeOptions { certificatePath?: string debug?: boolean distImportMapPath?: string + inspectSettings?: InspectSettings importMaps?: ImportMapFile[] onAfterDownload?: LifecycleHook onBeforeDownload?: LifecycleHook @@ -83,10 +94,12 @@ interface ServeOptions { port: number } +// eslint-disable-next-line complexity, max-statements const serve = async ({ certificatePath, debug, distImportMapPath, + inspectSettings, formatExportTypeError, formatImportError, importMaps, @@ -122,6 +135,14 @@ const serve = async ({ flags.push('--quiet') } + if (inspectSettings && inspectSettings.enabled) { + if (inspectSettings.pause) { + flags.push(inspectSettings.address ? `--inspect-brk=${inspectSettings.address}` : '--inspect-brk') + } else { + flags.push(inspectSettings.address ? `--inspect=${inspectSettings.address}` : '--inspect') + } + } + const server = await prepareServer({ deno, distDirectory, From b39688026e5bfe696e15d63238191267932de63c Mon Sep 17 00:00:00 2001 From: "token-generator-app[bot]" <82042599+token-generator-app[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 15:21:35 +0000 Subject: [PATCH 2/2] chore(main): release 1.1.1 --- CHANGELOG.md | 17 +++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97e9052c..1727dc52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +### [1.1.1](https://github.com/netlify/edge-bundler/compare/v1.1.0...v1.1.1) (2022-05-25) + + +### Features + +* support for Edge Functions debugging ([#31](https://github.com/netlify/edge-bundler/issues/31)) ([d69c79e](https://github.com/netlify/edge-bundler/commit/d69c79edb75f0bd1cf177c8c2e7fde0d20f923c2)) + + +### Bug Fixes + +* **deps:** update dependency del to v6.1.0 ([#35](https://github.com/netlify/edge-bundler/issues/35)) ([0c4ff08](https://github.com/netlify/edge-bundler/commit/0c4ff08cf5ccbe629e579ac00458db9227ef26f5)) + + +### Miscellaneous Chores + +* release 1.1.1 ([#33](https://github.com/netlify/edge-bundler/issues/33)) ([6c25ee7](https://github.com/netlify/edge-bundler/commit/6c25ee742f4f8993f0dd10418f555ce6cf63afc5)) + ## [1.1.0](https://github.com/netlify/edge-bundler/compare/v1.0.0...v1.1.0) (2022-05-05) diff --git a/package-lock.json b/package-lock.json index 04ec83d7..be4d42e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@netlify/edge-bundler", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@netlify/edge-bundler", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "dependencies": { "common-path-prefix": "^3.0.0", diff --git a/package.json b/package.json index d9bd33ae..6b31c11d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netlify/edge-bundler", - "version": "1.1.0", + "version": "1.1.1", "description": "Intelligently prepare Netlify Edge Functions for deployment", "type": "module", "main": "./dist/index.js",