Skip to content

Commit

Permalink
fix: compat with newest @types/node to leverage OutgoingHttpHeader
Browse files Browse the repository at this point in the history
…for httpExecutor's `RequestHeaders` (#7806)
  • Loading branch information
AviVahl committed Oct 26, 2023
1 parent 87eae1c commit db424e8
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 36 deletions.
6 changes: 6 additions & 0 deletions .changeset/brave-bats-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"builder-util-runtime": patch
"builder-util": patch
---

fix: update @types/node for compat with newest @types/node
6 changes: 6 additions & 0 deletions .changeset/spicy-kiwis-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"builder-util-runtime": patch
"builder-util": patch
---

fix: compat with newest @types/node
4 changes: 2 additions & 2 deletions docs/auto-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ Define `KEYGEN_TOKEN` environment variable.
* **<code id="ReleaseNoteInfo-note">note</code>** String | "undefined" - The note.
<a name="RequestHeaders"></a>
### `RequestHeaders` ⇐ <code>[key: string]: string</code>
### `RequestHeaders` ⇐ <code>[key: string]: OutgoingHttpHeader | undefined</code>
**Kind**: interface of [<code>builder-util-runtime</code>](#module_builder-util-runtime)<br/>
**Extends**: <code>[key: string]: string</code>
**Extends**: <code>[key: string]: OutgoingHttpHeader | undefined</code>
<a name="S3Options"></a>
### `S3Options` ⇐ <code>[BaseS3Options](electron-builder#BaseS3Options)</code>
**Kind**: interface of [<code>builder-util-runtime</code>](#module_builder-util-runtime)<br/>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@babel/plugin-transform-modules-commonjs": "7.15.4",
"@changesets/changelog-github": "0.4.7",
"@changesets/cli": "2.25.0",
"@types/node": "16.11.43",
"@types/node": "16.18.55",
"@typescript-eslint/eslint-plugin": "5.41.0",
"@typescript-eslint/parser": "5.41.0",
"catharsis": "0.9.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/builder-util-runtime/src/httpExecutor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BinaryToTextEncoding, createHash, Hash } from "crypto"
import _debug from "debug"
import { createWriteStream } from "fs"
import { IncomingMessage, OutgoingHttpHeaders, RequestOptions } from "http"
import { IncomingMessage, OutgoingHttpHeader, OutgoingHttpHeaders, RequestOptions } from "http"
import { Socket } from "net"
import { Transform } from "stream"
import { URL } from "url"
Expand All @@ -12,7 +12,7 @@ import { ProgressCallbackTransform, ProgressInfo } from "./ProgressCallbackTrans
const debug = _debug("electron-builder")

export interface RequestHeaders extends OutgoingHttpHeaders {
[key: string]: string
[key: string]: OutgoingHttpHeader | undefined
}

export interface DownloadOptions {
Expand Down
63 changes: 33 additions & 30 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion scripts/jsdoc/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function identifierToLink(id, root) {
}
if (id.endsWith(".RequestHeaders")) {
// don't want complicate docs, if someone need - just see source code
return "[key: string]: string"
return "[key: string]: OutgoingHttpHeader | undefined"
}

console.warn(`Unresolved member (helpers.js) ${id}`)
Expand Down

0 comments on commit db424e8

Please sign in to comment.