Skip to content

Commit

Permalink
Change global augmentation for newer TS
Browse files Browse the repository at this point in the history
Newer TypeScript versions don't accept the way we augment the global
object making the build fail sometimes. Doing it this way we ensure it
always works.
  • Loading branch information
luismiramirez committed Nov 17, 2021
1 parent 875feaa commit bf69146
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: "patch"
---

Fix TypeScript compatibility for global object augmentation.
5 changes: 5 additions & 0 deletions packages/nodejs/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export {}

declare global {
var __APPSIGNAL__: any
}
2 changes: 1 addition & 1 deletion packages/nodejs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*", "vendor.d.ts"],
"include": ["src/**/*", "vendor.d.ts", "global.d.ts"],
"exclude": [
"src/**/__tests__",
"src/**/__mocks__"
Expand Down
6 changes: 0 additions & 6 deletions packages/nodejs/vendor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,3 @@ declare module "require-in-the-middle" {

export = Hook
}

declare module NodeJS {
interface Global {
__APPSIGNAL__: any
}
}

0 comments on commit bf69146

Please sign in to comment.