Skip to content

Commit

Permalink
Merge branch 'release-please--branches--main--components--edge-bundle…
Browse files Browse the repository at this point in the history
…r' of github.com:netlify/edge-bundler into release-please--branches--main--components--edge-bundler
  • Loading branch information
jackiewmacharia committed May 25, 2022
2 parents 601e914 + b396880 commit efdbf03
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

### [1.1.1](https://github.com/netlify/edge-bundler/compare/v1.1.0...v1.1.1) (2022-05-23)
### [1.2.0](https://github.com/netlify/edge-bundler/compare/v1.1.0...v1.2.0) (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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netlify/edge-bundler",
"version": "1.1.1",
"version": "1.2.0",
"description": "Intelligently prepare Netlify Edge Functions for deployment",
"type": "module",
"main": "./dist/index.js",
Expand Down
21 changes: 21 additions & 0 deletions src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit efdbf03

Please sign in to comment.