refactor: move to emittery

This commit is contained in:
Derrick Hammer 2023-07-01 15:56:28 -04:00
parent 3036ba1d5e
commit f7cc9a755e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 32 additions and 14 deletions

40
npm-shrinkwrap.json generated
View File

@ -9,7 +9,7 @@
"version": "0.1.0-develop.7", "version": "0.1.0-develop.7",
"dependencies": { "dependencies": {
"@lumeweb/libweb": "0.2.0-develop.20", "@lumeweb/libweb": "0.2.0-develop.20",
"eventemitter2": "^6.4.9" "emittery": "^1.0.1"
}, },
"devDependencies": { "devDependencies": {
"@lumeweb/node-library-preset": "^0.2.5", "@lumeweb/node-library-preset": "^0.2.5",
@ -5585,12 +5585,11 @@
"peer": true "peer": true
}, },
"node_modules/emittery": { "node_modules/emittery": {
"version": "0.13.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.0.1.tgz",
"integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "integrity": "sha512-2ID6FdrMD9KDLldGesP6317G78K7km/kMcwItRtVFva7I/cSEOIaLpewaUb+YLXVwdAp3Ctfxh/V5zIl1sj7dQ==",
"peer": true,
"engines": { "engines": {
"node": ">=12" "node": ">=14.16"
}, },
"funding": { "funding": {
"url": "https://github.com/sindresorhus/emittery?sponsor=1" "url": "https://github.com/sindresorhus/emittery?sponsor=1"
@ -6340,11 +6339,6 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/eventemitter2": {
"version": "6.4.9",
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz",
"integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg=="
},
"node_modules/eventemitter3": { "node_modules/eventemitter3": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
@ -8608,6 +8602,18 @@
"node": "^14.15.0 || ^16.10.0 || >=18.0.0" "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
} }
}, },
"node_modules/jest-runner/node_modules/emittery": {
"version": "0.13.1",
"resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz",
"integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==",
"peer": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sindresorhus/emittery?sponsor=1"
}
},
"node_modules/jest-runtime": { "node_modules/jest-runtime": {
"version": "29.5.0", "version": "29.5.0",
"resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz",
@ -8740,6 +8746,18 @@
"node": "^14.15.0 || ^16.10.0 || >=18.0.0" "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
} }
}, },
"node_modules/jest-watcher/node_modules/emittery": {
"version": "0.13.1",
"resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz",
"integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==",
"peer": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sindresorhus/emittery?sponsor=1"
}
},
"node_modules/jest-worker": { "node_modules/jest-worker": {
"version": "29.5.0", "version": "29.5.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz",

View File

@ -35,7 +35,7 @@
}, },
"dependencies": { "dependencies": {
"@lumeweb/libweb": "0.2.0-develop.20", "@lumeweb/libweb": "0.2.0-develop.20",
"eventemitter2": "^6.4.9" "emittery": "^1.0.1"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"

View File

@ -1,4 +1,4 @@
import EventEmitter from "eventemitter2"; import Emittery from "emittery";
import { callModule, connectModule, log, logErr } from "../api.js"; import { callModule, connectModule, log, logErr } from "../api.js";
import { DataFn, ErrTuple } from "@lumeweb/libweb"; import { DataFn, ErrTuple } from "@lumeweb/libweb";
@ -21,7 +21,7 @@ interface ModuleBagBound extends ModuleBag {
connectModule: connectModuleBound; connectModule: connectModuleBound;
} }
export abstract class Client extends EventEmitter { export abstract class Client extends Emittery {
private _module: string; private _module: string;
constructor(module: string) { constructor(module: string) {