webext-messenger 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,3 @@
1
- import browser from "webextension-polyfill";
2
1
  import { serializeError } from "serialize-error";
3
2
  import { messenger } from "./sender.js";
4
3
  import { handlers, isObject, MessengerError, debug, __webextMessenger, } from "./shared.js";
@@ -1,4 +1,3 @@
1
- import browser from "webextension-polyfill";
2
1
  import pRetry from "p-retry";
3
2
  import { isBackground } from "webext-detect-page";
4
3
  import { deserializeError } from "serialize-error";
@@ -30,9 +30,8 @@ export const handlers = new Map();
30
30
  export const debug = logging ? console.debug.bind(console, "Messenger:") : noop;
31
31
  export const warn = logging ? console.warn.bind(console, "Messenger:") : noop;
32
32
  export function isErrorObject(error) {
33
- var _a;
34
33
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a type guard function and it uses ?.
35
- return typeof ((_a = error) === null || _a === void 0 ? void 0 : _a.message) === "string";
34
+ return typeof (error === null || error === void 0 ? void 0 : error.message) === "string";
36
35
  }
37
36
  export async function delay(milliseconds) {
38
37
  return new Promise((resolve) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webext-messenger",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "Browser Extension component messaging framework",
5
5
  "keywords": [],
6
6
  "repository": "pixiebrix/webext-messenger",
@@ -8,14 +8,6 @@
8
8
  "author": "Federico Brigante for PixieBrix <federico@pixiebrix.com> (https://www.pixiebrix.com)",
9
9
  "type": "module",
10
10
  "main": "distribution/index.js",
11
- "alias": {
12
- "./this-stuff-is-just-for-local-parcel-tests": "./package.json",
13
- "./source/sender.js": "./source/sender.ts",
14
- "./source/receiver.js": "./source/receiver.ts",
15
- "./source/types.js": "./source/types.ts",
16
- "./source/shared.js": "./source/shared.ts",
17
- "./source/thisTarget.js": "./source/thisTarget.ts"
18
- },
19
11
  "scripts": {
20
12
  "build": "tsc",
21
13
  "demo:watch": "WEBEXT_MESSENGER_LOGGING=true parcel watch --no-cache --no-hmr",
@@ -89,8 +81,8 @@
89
81
  "*.test.ts"
90
82
  ],
91
83
  "rules": {
92
- "@typescript-eslint/no-non-null-assertion": "off",
93
84
  "@typescript-eslint/no-explicit-any": "off",
85
+ "@typescript-eslint/no-non-null-assertion": "off",
94
86
  "@typescript-eslint/no-unsafe-member-access": "off"
95
87
  }
96
88
  },
@@ -105,31 +97,44 @@
105
97
  ]
106
98
  },
107
99
  "dependencies": {
108
- "p-retry": "^5.0.0",
109
- "serialize-error": "^9.0.0",
110
- "type-fest": "^2.11.1",
111
- "webext-detect-page": "^4.0.0",
112
- "webextension-polyfill": "^0.8.0"
100
+ "p-retry": "^5.1.0",
101
+ "serialize-error": "^9.1.1",
102
+ "type-fest": "^2.12.1",
103
+ "webext-detect-page": "^4.0.1"
113
104
  },
114
105
  "devDependencies": {
115
- "@parcel/config-webextension": "^2.2.1",
106
+ "@parcel/config-webextension": "^2.4.0",
116
107
  "@sindresorhus/tsconfig": "^2.0.0",
117
- "@types/chrome": "^0.0.178",
108
+ "@types/chrome": "^0.0.180",
118
109
  "@types/tape": "^4.13.2",
119
- "@types/webextension-polyfill": "^0.8.2",
120
- "@typescript-eslint/eslint-plugin": "^5.10.2",
121
- "@typescript-eslint/parser": "^5.10.2",
122
- "eslint": "^8.8.0",
123
- "eslint-config-prettier": "^8.3.0",
124
- "eslint-config-xo": "^0.39.0",
125
- "eslint-config-xo-typescript": "^0.49.0",
110
+ "@types/webextension-polyfill": "^0.8.3",
111
+ "@typescript-eslint/eslint-plugin": "^5.17.0",
112
+ "@typescript-eslint/parser": "^5.17.0",
113
+ "buffer": "^6.0.3",
114
+ "eslint": "^8.12.0",
115
+ "eslint-config-prettier": "^8.5.0",
116
+ "eslint-config-xo": "^0.40.0",
117
+ "eslint-config-xo-typescript": "^0.50.0",
126
118
  "eslint-plugin-import": "^2.25.4",
127
- "eslint-plugin-unicorn": "^40.1.0",
119
+ "eslint-plugin-unicorn": "^41.0.1",
120
+ "events": "^3.3.0",
128
121
  "npm-run-all": "^4.1.5",
129
- "parcel": "^2.2.1",
130
- "tape": "^5.5.0",
131
- "typescript": "^4.5.5",
132
- "webext-content-scripts": "^1.0.1"
122
+ "parcel": "^2.4.0",
123
+ "path-browserify": "^1.0.1",
124
+ "process": "^0.11.10",
125
+ "stream-browserify": "^3.0.0",
126
+ "tape": "^5.5.2",
127
+ "typescript": "^4.6.3",
128
+ "webext-content-scripts": "^1.0.1",
129
+ "webextension-polyfill": "^0.9.0"
130
+ },
131
+ "alias": {
132
+ "./this-stuff-is-just-for-local-parcel-tests": "./package.json",
133
+ "./source/sender.js": "./source/sender.ts",
134
+ "./source/receiver.js": "./source/receiver.ts",
135
+ "./source/types.js": "./source/types.ts",
136
+ "./source/shared.js": "./source/shared.ts",
137
+ "./source/thisTarget.js": "./source/thisTarget.ts"
133
138
  },
134
139
  "targets": {
135
140
  "main": false,