From ad4a033888854e31820e40b0412e778e7514e4fb Mon Sep 17 00:00:00 2001 From: tripodsgames Date: Tue, 14 Sep 2021 21:20:10 -0300 Subject: [PATCH 1/8] Use esbuild to build commonjs code. --- README.md | 4 - node-ipc.cjs | 1269 +++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 1057 ++++++++----------------------------- package.json | 8 +- 4 files changed, 1488 insertions(+), 850 deletions(-) create mode 100644 node-ipc.cjs diff --git a/README.md b/README.md index b1bb83f..0e222f7 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,6 @@ A great solution for complex multiprocess **Neural Networking** in Node.JS **npm install node-ipc** -#### for commonjs or node key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __require = typeof require !== "undefined" ? require : (x) => { + throw new Error('Dynamic require of "' + x + '" is not supported'); +}; +var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module2) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; +var __accessCheck = (obj, member, msg) => { + if (!member.has(obj)) + throw TypeError("Cannot " + msg); +}; +var __privateGet = (obj, member, getter) => { + __accessCheck(obj, member, "read from private field"); + return getter ? getter.call(obj) : member.get(obj); +}; +var __privateAdd = (obj, member, value) => { + if (member.has(obj)) + throw TypeError("Cannot add the same private member more than once"); + member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +}; + +// node_modules/js-message/Message.js +var require_Message = __commonJS({ + "node_modules/js-message/Message.js"(exports, module2) { + function Message3() { + Object.defineProperties(this, { + data: { + enumerable: true, + get: getData, + set: setData + }, + type: { + enumerable: true, + get: getType, + set: setType + }, + load: { + enumerable: true, + writable: false, + value: parse + }, + JSON: { + enumerable: true, + get: getJSON + } + }); + var type = ""; + var data = {}; + function getType() { + return type; + } + function getData() { + return data; + } + function getJSON() { + return JSON.stringify({ + type, + data + }); + } + function setType(value) { + type = value; + } + function setData(value) { + data = value; + } + function parse(message) { + try { + var message = JSON.parse(message); + type = message.type; + data = message.data; + } catch (err) { + var badMessage = message; + type = "error", data = { + message: "Invalid JSON response format", + err, + response: badMessage + }; + } + } + } + module2.exports = Message3; + } +}); + +// node_modules/js-queue/queue.js +var require_queue = __commonJS({ + "node_modules/js-queue/queue.js"(exports, module2) { + function Queue2(asStack) { + Object.defineProperties(this, { + add: { + enumerable: true, + writable: false, + value: addToQueue + }, + next: { + enumerable: true, + writable: false, + value: run + }, + clear: { + enumerable: true, + writable: false, + value: clearQueue + }, + contents: { + enumerable: false, + get: getQueue, + set: setQueue + }, + autoRun: { + enumerable: true, + writable: true, + value: true + }, + stop: { + enumerable: true, + writable: true, + value: false + } + }); + var queue = []; + var running = false; + var stop = false; + function clearQueue() { + queue = []; + return queue; + } + function getQueue() { + return queue; + } + function setQueue(val) { + queue = val; + return queue; + } + function addToQueue() { + for (var i in arguments) { + queue.push(arguments[i]); + } + if (!running && !this.stop && this.autoRun) { + this.next(); + } + } + function run() { + running = true; + if (queue.length < 1 || this.stop) { + running = false; + return; + } + queue.shift().bind(this)(); + } + } + module2.exports = Queue2; + } +}); + +// node-ipc.js +__export(exports, { + IPCModule: () => IPCModule, + default: () => singleton +}); + +// entities/Defaults.js +var import_os = __toModule(require("os")); +var Defaults = class { + constructor() { + __publicField(this, "appspace", "app."); + __publicField(this, "socketRoot", "/tmp/"); + __publicField(this, "id", import_os.default.hostname()); + __publicField(this, "encoding", "utf8"); + __publicField(this, "rawBuffer", false); + __publicField(this, "sync", false); + __publicField(this, "unlink", true); + __publicField(this, "delimiter", "\f"); + __publicField(this, "silent", false); + __publicField(this, "logDepth", 5); + __publicField(this, "logInColor", true); + __publicField(this, "logger", console.log.bind(console)); + __publicField(this, "maxConnections", 100); + __publicField(this, "retry", 500); + __publicField(this, "maxRetries", Infinity); + __publicField(this, "stopRetrying", false); + __publicField(this, "IPType", getIPType()); + __publicField(this, "tls", false); + __publicField(this, "networkHost", this.IPType == "IPv6" ? "::1" : "127.0.0.1"); + __publicField(this, "networkPort", 8e3); + __publicField(this, "readableAll", false); + __publicField(this, "writableAll", false); + __publicField(this, "interface", { + localAddress: false, + localPort: false, + family: false, + hints: false, + lookup: false + }); + } +}; +function getIPType() { + const networkInterfaces = import_os.default.networkInterfaces(); + let IPType = ""; + if (networkInterfaces && Array.isArray(networkInterfaces) && networkInterfaces.length > 0) { + IPType = networkInterfaces[Object.keys(networkInterfaces)[0]][0].family; + } + return IPType; +} + +// dao/client.js +var import_net = __toModule(require("net")); +var import_tls = __toModule(require("tls")); + +// entities/EventParser.js +var Parser = class { + constructor(config) { + if (!config) { + config = new Defaults(); + } + this.delimiter = config.delimiter; + } + format(message) { + if (!message.data && message.data !== false && message.data !== 0) { + message.data = {}; + } + if (message.data["_maxListeners"]) { + message.data = {}; + } + message = message.JSON + this.delimiter; + return message; + } + parse(data) { + let events = data.split(this.delimiter); + events.pop(); + return events; + } +}; + +// dao/client.js +var import_js_message = __toModule(require_Message()); +var import_fs = __toModule(require("fs")); +var import_js_queue = __toModule(require_queue()); + +// node_modules/strong-type/index.js +var Fake = class { +}; +var FakeCore = class { +}; +var Is = class { + constructor(strict = true) { + this.strict = strict; + } + throw(valueType, expectedType) { + let err = new TypeError(); + err.message = `expected type of ${valueType} to be ${expectedType}`; + if (!this.strict) { + return false; + } + throw err; + } + typeCheck(value, type) { + if (typeof value === type) { + return true; + } + return this.throw(typeof value, type); + } + instanceCheck(value = new Fake(), constructor = FakeCore) { + if (value instanceof constructor) { + return true; + } + return this.throw(typeof value, constructor.name); + } + symbolStringCheck(value, type) { + if (Object.prototype.toString.call(value) == `[object ${type}]`) { + return true; + } + return this.throw(Object.prototype.toString.call(value), `[object ${type}]`); + } + compare(value, targetValue, typeName) { + if (value == targetValue) { + return true; + } + return this.throw(typeof value, typeName); + } + defined(value) { + const weakIs = new Is(false); + if (weakIs.undefined(value)) { + return this.throw("undefined", "defined"); + } + return true; + } + any(value) { + return this.defined(value); + } + exists(value) { + return this.defined(value); + } + union(value, typesString) { + const types = typesString.split("|"); + const weakIs = new Is(false); + let pass = false; + let type = "undefined"; + for (type of types) { + try { + if (weakIs[type](value)) { + pass = true; + break; + } + } catch (err) { + return this.throw(type, "a method available on strong-type"); + } + } + if (pass) { + return this[type](value); + } + return this.throw(typeof value, types.join("|")); + } + finite(value) { + if (isFinite(value)) { + return true; + } + return this.throw(typeof value, "finite"); + } + NaN(value) { + if (!this.number(value)) { + return this.number(value); + } + if (isNaN(value)) { + return true; + } + return this.throw(typeof value, "NaN"); + } + null(value) { + return this.compare(value, null, "null"); + } + array(value) { + return this.instanceCheck(value, Array); + } + boolean(value) { + return this.typeCheck(value, "boolean"); + } + bigInt(value) { + return this.typeCheck(value, "bigint"); + } + date(value) { + return this.instanceCheck(value, Date); + } + generator(value) { + return this.symbolStringCheck(value, "Generator"); + } + asyncGenerator(value) { + return this.symbolStringCheck(value, "AsyncGenerator"); + } + globalThis(value) { + return this.compare(value, globalThis, "explicitly globalThis, not window, global nor self"); + } + infinity(value) { + return this.compare(value, Infinity, "Infinity"); + } + map(value) { + return this.instanceCheck(value, Map); + } + weakMap(value) { + return this.instanceCheck(value, WeakMap); + } + number(value) { + return this.typeCheck(value, "number"); + } + object(value) { + return this.typeCheck(value, "object"); + } + promise(value) { + return this.instanceCheck(value, Promise); + } + regExp(value) { + return this.instanceCheck(value, RegExp); + } + undefined(value) { + return this.typeCheck(value, "undefined"); + } + set(value) { + return this.instanceCheck(value, Set); + } + weakSet(value) { + return this.instanceCheck(value, WeakSet); + } + string(value) { + return this.typeCheck(value, "string"); + } + symbol(value) { + return this.typeCheck(value, "symbol"); + } + function(value) { + return this.typeCheck(value, "function"); + } + asyncFunction(value) { + return this.symbolStringCheck(value, "AsyncFunction"); + } + generatorFunction(value) { + return this.symbolStringCheck(value, "GeneratorFunction"); + } + asyncGeneratorFunction(value) { + return this.symbolStringCheck(value, "AsyncGeneratorFunction"); + } + error(value) { + return this.instanceCheck(value, Error); + } + evalError(value) { + return this.instanceCheck(value, EvalError); + } + rangeError(value) { + return this.instanceCheck(value, RangeError); + } + referenceError(value) { + return this.instanceCheck(value, ReferenceError); + } + syntaxError(value) { + return this.instanceCheck(value, SyntaxError); + } + typeError(value) { + return this.instanceCheck(value, TypeError); + } + URIError(value) { + return this.instanceCheck(value, URIError); + } + bigInt64Array(value) { + return this.instanceCheck(value, BigInt64Array); + } + bigUint64Array(value) { + return this.instanceCheck(value, BigUint64Array); + } + float32Array(value) { + return this.instanceCheck(value, Float32Array); + } + float64Array(value) { + return this.instanceCheck(value, Float64Array); + } + int8Array(value) { + return this.instanceCheck(value, Int8Array); + } + int16Array(value) { + return this.instanceCheck(value, Int16Array); + } + int32Array(value) { + return this.instanceCheck(value, Int32Array); + } + uint8Array(value) { + return this.instanceCheck(value, Uint8Array); + } + uint8ClampedArray(value) { + return this.instanceCheck(value, Uint8ClampedArray); + } + uint16Array(value) { + return this.instanceCheck(value, Uint16Array); + } + uint32Array(value) { + return this.instanceCheck(value, Uint32Array); + } + arrayBuffer(value) { + return this.instanceCheck(value, ArrayBuffer); + } + dataView(value) { + return this.instanceCheck(value, DataView); + } + sharedArrayBuffer(value) { + return this.instanceCheck(value, function() { + try { + return SharedArrayBuffer; + } catch (e) { + return Fake; + } + }()); + } + intlDateTimeFormat(value) { + return this.instanceCheck(value, Intl.DateTimeFormat); + } + intlCollator(value) { + return this.instanceCheck(value, Intl.Collator); + } + intlDisplayNames(value) { + return this.instanceCheck(value, Intl.DisplayNames); + } + intlListFormat(value) { + return this.instanceCheck(value, Intl.ListFormat); + } + intlLocale(value) { + return this.instanceCheck(value, Intl.Locale); + } + intlNumberFormat(value) { + return this.instanceCheck(value, Intl.NumberFormat); + } + intlPluralRules(value) { + return this.instanceCheck(value, Intl.PluralRules); + } + intlRelativeTimeFormat(value) { + return this.instanceCheck(value, Intl.RelativeTimeFormat); + } + intlRelativeTimeFormat(value) { + return this.instanceCheck(value, Intl.RelativeTimeFormat); + } + finalizationRegistry(value) { + return this.instanceCheck(value, FinalizationRegistry); + } + weakRef(value) { + return this.instanceCheck(value, WeakRef); + } +}; + +// node_modules/event-pubsub/index.js +var is = new Is(); +var _handleOnce, _all, _once, _events; +var EventPubSub = class { + constructor() { + __privateAdd(this, _handleOnce, (type, handlers, ...args) => { + is.string(type); + is.array(handlers); + const deleteOnceHandled = []; + for (let handler of handlers) { + handler(...args); + if (handler[__privateGet(this, _once)]) { + deleteOnceHandled.push(handler); + } + } + for (let handler of deleteOnceHandled) { + this.off(type, handler); + } + }); + __privateAdd(this, _all, Symbol.for("event-pubsub-all")); + __privateAdd(this, _once, Symbol.for("event-pubsub-once")); + __privateAdd(this, _events, {}); + } + on(type, handler, once = false) { + is.string(type); + is.function(handler); + is.boolean(once); + if (type == "*") { + type = __privateGet(this, _all); + } + if (!__privateGet(this, _events)[type]) { + __privateGet(this, _events)[type] = []; + } + handler[__privateGet(this, _once)] = once; + __privateGet(this, _events)[type].push(handler); + return this; + } + once(type, handler) { + return this.on(type, handler, true); + } + off(type = "*", handler = "*") { + is.string(type); + if (type == __privateGet(this, _all).toString() || type == "*") { + type = __privateGet(this, _all); + } + if (!__privateGet(this, _events)[type]) { + return this; + } + if (handler == "*") { + delete __privateGet(this, _events)[type]; + return this; + } + is.function(handler); + const handlers = __privateGet(this, _events)[type]; + while (handlers.includes(handler)) { + handlers.splice(handlers.indexOf(handler), 1); + } + if (handlers.length < 1) { + delete __privateGet(this, _events)[type]; + } + return this; + } + emit(type, ...args) { + is.string(type); + const globalHandlers = __privateGet(this, _events)[__privateGet(this, _all)] || []; + __privateGet(this, _handleOnce).call(this, __privateGet(this, _all).toString(), globalHandlers, type, ...args); + if (!__privateGet(this, _events)[type]) { + return this; + } + const handlers = __privateGet(this, _events)[type]; + __privateGet(this, _handleOnce).call(this, type, handlers, ...args); + return this; + } + reset() { + this.off(__privateGet(this, _all).toString()); + for (let type in __privateGet(this, _events)) { + this.off(type); + } + return this; + } + get list() { + return Object.assign({}, __privateGet(this, _events)); + } +}; +_handleOnce = new WeakMap(); +_all = new WeakMap(); +_once = new WeakMap(); +_events = new WeakMap(); + +// dao/client.js +var eventParser = new Parser(); +var Client = class extends EventPubSub { + constructor(config, log2) { + super(); + __publicField(this, "Client", Client); + __publicField(this, "queue", new import_js_queue.default()); + __publicField(this, "socket", false); + __publicField(this, "connect", connect); + __publicField(this, "emit", emit); + __publicField(this, "retriesRemaining", 0); + __publicField(this, "explicitlyDisconnected", false); + this.config = config; + this.log = log2; + this.publish = super.emit; + config.maxRetries ? this.retriesRemaining = config.maxRetries : 0; + eventParser = new Parser(this.config); + } +}; +function emit(type, data) { + this.log("dispatching event to ", this.id, this.path, " : ", type, ",", data); + let message = new import_js_message.default(); + message.type = type; + message.data = data; + if (this.config.rawBuffer) { + message = Buffer.from(type, this.config.encoding); + } else { + message = eventParser.format(message); + } + if (!this.config.sync) { + this.socket.write(message); + return; + } + this.queue.add(syncEmit.bind(this, message)); +} +function syncEmit(message) { + this.log("dispatching event to ", this.id, this.path, " : ", message); + this.socket.write(message); +} +function connect() { + let client = this; + client.log("requested connection to ", client.id, client.path); + if (!this.path) { + client.log("\n\n######\nerror: ", client.id, " client has not specified socket path it wishes to connect to."); + return; + } + const options = {}; + if (!client.port) { + client.log("Connecting client on Unix Socket :", client.path); + options.path = client.path; + if (process.platform === "win32" && !client.path.startsWith("\\\\.\\pipe\\")) { + options.path = options.path.replace(/^\//, ""); + options.path = options.path.replace(/\//g, "-"); + options.path = `\\\\.\\pipe\\${options.path}`; + } + client.socket = import_net.default.connect(options); + } else { + options.host = client.path; + options.port = client.port; + if (client.config.interface.localAddress) { + options.localAddress = client.config.interface.localAddress; + } + if (client.config.interface.localPort) { + options.localPort = client.config.interface.localPort; + } + if (client.config.interface.family) { + options.family = client.config.interface.family; + } + if (client.config.interface.hints) { + options.hints = client.config.interface.hints; + } + if (client.config.interface.lookup) { + options.lookup = client.config.interface.lookup; + } + if (!client.config.tls) { + client.log("Connecting client via TCP to", options); + client.socket = import_net.default.connect(options); + } else { + client.log("Connecting client via TLS to", client.path, client.port, client.config.tls); + if (client.config.tls.private) { + client.config.tls.key = import_fs.default.readFileSync(client.config.tls.private); + } + if (client.config.tls.public) { + client.config.tls.cert = import_fs.default.readFileSync(client.config.tls.public); + } + if (client.config.tls.trustedConnections) { + if (typeof client.config.tls.trustedConnections === "string") { + client.config.tls.trustedConnections = [client.config.tls.trustedConnections]; + } + client.config.tls.ca = []; + for (let i = 0; i < client.config.tls.trustedConnections.length; i++) { + client.config.tls.ca.push(import_fs.default.readFileSync(client.config.tls.trustedConnections[i])); + } + } + Object.assign(client.config.tls, options); + client.socket = import_tls.default.connect(client.config.tls); + } + } + client.socket.setEncoding(this.config.encoding); + client.socket.on("error", function(err) { + client.log("\n\n######\nerror: ", err); + client.publish("error", err); + }); + client.socket.on("connect", function connectionMade() { + client.publish("connect"); + client.retriesRemaining = client.config.maxRetries; + client.log("retrying reset"); + }); + client.socket.on("close", function connectionClosed() { + client.log("connection closed", client.id, client.path, client.retriesRemaining, "tries remaining of", client.config.maxRetries); + if (client.config.stopRetrying || client.retriesRemaining < 1 || client.explicitlyDisconnected) { + client.publish("disconnect"); + client.log(client.config.id, "exceeded connection rety amount of", " or stopRetrying flag set."); + client.socket.destroy(); + client.publish("destroy"); + client = void 0; + return; + } + setTimeout(function retryTimeout() { + if (client.explicitlyDisconnected) { + return; + } + client.retriesRemaining--; + client.connect(); + }.bind(null, client), client.config.retry); + client.publish("disconnect"); + }); + client.socket.on("data", function(data) { + client.log("## received events ##"); + if (client.config.rawBuffer) { + client.publish("data", Buffer.from(data, client.config.encoding)); + if (!client.config.sync) { + return; + } + client.queue.next(); + return; + } + if (!this.ipcBuffer) { + this.ipcBuffer = ""; + } + data = this.ipcBuffer += data; + if (data.slice(-1) != eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1) { + client.log("Messages are large, You may want to consider smaller messages."); + return; + } + this.ipcBuffer = ""; + const events = eventParser.parse(data); + const eCount = events.length; + for (let i = 0; i < eCount; i++) { + let message = new import_js_message.default(); + message.load(events[i]); + client.log("detected event", message.type, message.data); + client.publish(message.type, message.data); + } + if (!client.config.sync) { + return; + } + client.queue.next(); + }); +} + +// dao/socketServer.js +var import_net2 = __toModule(require("net")); +var import_tls2 = __toModule(require("tls")); +var import_fs2 = __toModule(require("fs")); +var import_dgram = __toModule(require("dgram")); +var import_js_message2 = __toModule(require_Message()); +var eventParser2 = new Parser(); +var Server = class extends EventPubSub { + constructor(path, config, log2, port) { + super(); + __publicField(this, "udp4", false); + __publicField(this, "udp6", false); + __publicField(this, "server", false); + __publicField(this, "sockets", []); + __publicField(this, "emit", emit2); + __publicField(this, "broadcast", broadcast); + this.config = config; + this.path = path; + this.port = port; + this.log = log2; + this.publish = super.emit; + eventParser2 = new Parser(this.config); + this.on("close", serverClosed.bind(this)); + } + onStart(socket) { + this.publish("start", socket); + } + stop() { + this.server.close(); + } + start() { + if (!this.path) { + this.log("Socket Server Path not specified, refusing to start"); + return; + } + if (this.config.unlink) { + import_fs2.default.unlink(this.path, startServer.bind(this)); + } else { + startServer.bind(this)(); + } + } +}; +function emit2(socket, type, data) { + this.log("dispatching event to socket", " : ", type, data); + let message = new import_js_message2.default(); + message.type = type; + message.data = data; + if (this.config.rawBuffer) { + this.log(this.config.encoding); + message = Buffer.from(type, this.config.encoding); + } else { + message = eventParser2.format(message); + } + if (this.udp4 || this.udp6) { + if (!socket.address || !socket.port) { + this.log("Attempting to emit to a single UDP socket without supplying socket address or port. Redispatching event as broadcast to all connected sockets"); + this.broadcast(type, data); + return; + } + this.server.write(message, socket); + return; + } + socket.write(message); +} +function broadcast(type, data) { + this.log("broadcasting event to all known sockets listening to ", this.path, " : ", this.port ? this.port : "", type, data); + let message = new import_js_message2.default(); + message.type = type; + message.data = data; + if (this.config.rawBuffer) { + message = Buffer.from(type, this.config.encoding); + } else { + message = eventParser2.format(message); + } + if (this.udp4 || this.udp6) { + for (let i = 1, count = this.sockets.length; i < count; i++) { + this.server.write(message, this.sockets[i]); + } + } else { + for (let i = 0, count = this.sockets.length; i < count; i++) { + this.sockets[i].write(message); + } + } +} +function serverClosed() { + for (let i = 0, count = this.sockets.length; i < count; i++) { + let socket = this.sockets[i]; + let destroyedSocketId = false; + if (socket) { + if (socket.readable) { + continue; + } + } + if (socket.id) { + destroyedSocketId = socket.id; + } + this.log("socket disconnected", destroyedSocketId.toString()); + if (socket && socket.destroy) { + socket.destroy(); + } + this.sockets.splice(i, 1); + this.publish("socket.disconnected", socket, destroyedSocketId); + return; + } +} +function gotData(socket, data, UDPSocket) { + let sock = this.udp4 || this.udp6 ? UDPSocket : socket; + if (this.config.rawBuffer) { + data = Buffer.from(data, this.config.encoding); + this.publish("data", data, sock); + return; + } + if (!sock.ipcBuffer) { + sock.ipcBuffer = ""; + } + data = sock.ipcBuffer += data; + if (data.slice(-1) != eventParser2.delimiter || data.indexOf(eventParser2.delimiter) == -1) { + this.log("Messages are large, You may want to consider smaller messages."); + return; + } + sock.ipcBuffer = ""; + data = eventParser2.parse(data); + while (data.length > 0) { + let message = new import_js_message2.default(); + message.load(data.shift()); + if (message.data && message.data.id) { + sock.id = message.data.id; + } + this.log("received event of : ", message.type, message.data); + this.publish(message.type, message.data, sock); + } +} +function socketClosed(socket) { + this.publish("close", socket); +} +function serverCreated(socket) { + this.sockets.push(socket); + if (socket.setEncoding) { + socket.setEncoding(this.config.encoding); + } + this.log("## socket connection to server detected ##"); + socket.on("close", socketClosed.bind(this)); + socket.on("error", function(err) { + this.log("server socket error", err); + this.publish("error", err); + }.bind(this)); + socket.on("data", gotData.bind(this, socket)); + socket.on("message", function(msg, rinfo) { + if (!rinfo) { + return; + } + this.log("Received UDP message from ", rinfo.address, rinfo.port); + let data; + if (this.config.rawSocket) { + data = Buffer.from(msg, this.config.encoding); + } else { + data = msg.toString(); + } + socket.emit("data", data, rinfo); + }.bind(this)); + this.publish("connect", socket); + if (this.config.rawBuffer) { + return; + } +} +function startServer() { + this.log("starting server on ", this.path, this.port ? `:${this.port}` : ""); + if (!this.udp4 && !this.udp6) { + this.log("starting TLS server", this.config.tls); + if (!this.config.tls) { + this.server = import_net2.default.createServer(serverCreated.bind(this)); + } else { + startTLSServer.bind(this)(); + } + } else { + this.server = import_dgram.default.createSocket(this.udp4 ? "udp4" : "udp6"); + this.server.write = UDPWrite.bind(this); + this.server.on("listening", function UDPServerStarted() { + serverCreated.bind(this)(this.server); + }.bind(this)); + } + this.server.on("error", function(err) { + this.log("server error", err); + this.publish("error", err); + }.bind(this)); + this.server.maxConnections = this.config.maxConnections; + if (!this.port) { + this.log("starting server as", "Unix || Windows Socket"); + if (process.platform === "win32") { + this.path = this.path.replace(/^\//, ""); + this.path = this.path.replace(/\//g, "-"); + this.path = `\\\\.\\pipe\\${this.path}`; + } + this.server.listen({ + path: this.path, + readableAll: this.config.readableAll, + writableAll: this.config.writableAll + }, this.onStart.bind(this)); + return; + } + if (!this.udp4 && !this.udp6) { + this.log("starting server as", this.config.tls ? "TLS" : "TCP"); + this.server.listen(this.port, this.path, this.onStart.bind(this)); + return; + } + this.log("starting server as", this.udp4 ? "udp4" : "udp6"); + this.server.bind(this.port, this.path); + this.onStart({ + address: this.path, + port: this.port + }); +} +function startTLSServer() { + this.log("starting TLS server", this.config.tls); + if (this.config.tls.private) { + this.config.tls.key = import_fs2.default.readFileSync(this.config.tls.private); + } else { + this.config.tls.key = import_fs2.default.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`); + } + if (this.config.tls.public) { + this.config.tls.cert = import_fs2.default.readFileSync(this.config.tls.public); + } else { + this.config.tls.cert = import_fs2.default.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`); + } + if (this.config.tls.dhparam) { + this.config.tls.dhparam = import_fs2.default.readFileSync(this.config.tls.dhparam); + } + if (this.config.tls.trustedConnections) { + if (typeof this.config.tls.trustedConnections === "string") { + this.config.tls.trustedConnections = [this.config.tls.trustedConnections]; + } + this.config.tls.ca = []; + for (let i = 0; i < this.config.tls.trustedConnections.length; i++) { + this.config.tls.ca.push(import_fs2.default.readFileSync(this.config.tls.trustedConnections[i])); + } + } + this.server = import_tls2.default.createServer(this.config.tls, serverCreated.bind(this)); +} +function UDPWrite(message, socket) { + let data = Buffer.from(message, this.config.encoding); + this.server.send(data, 0, data.length, socket.port, socket.address, function(err, bytes) { + if (err) { + this.log("error writing data to socket", err); + this.publish("error", function(err2) { + this.publish("error", err2); + }); + } + }); +} + +// services/IPC.js +var import_util = __toModule(require("util")); +var IPC = class { + constructor() { + __publicField(this, "config", new Defaults()); + __publicField(this, "of", {}); + __publicField(this, "server", false); + } + get connectTo() { + return connect2; + } + get connectToNet() { + return connectNet; + } + get disconnect() { + return disconnect; + } + get serve() { + return serve; + } + get serveNet() { + return serveNet; + } + get log() { + return log; + } + set connectTo(value) { + return connect2; + } + set connectToNet(value) { + return connectNet; + } + set disconnect(value) { + return disconnect; + } + set serve(value) { + return serve; + } + set serveNet(value) { + return serveNet; + } + set log(value) { + return log; + } +}; +function log(...args) { + if (this.config.silent) { + return; + } + for (let i = 0, count = args.length; i < count; i++) { + if (typeof args[i] != "object") { + continue; + } + args[i] = import_util.default.inspect(args[i], { + depth: this.config.logDepth, + colors: this.config.logInColor + }); + } + this.config.logger(args.join(" ")); +} +function disconnect(id) { + if (!this.of[id]) { + return; + } + this.of[id].explicitlyDisconnected = true; + this.of[id].off("*", "*"); + if (this.of[id].socket) { + if (this.of[id].socket.destroy) { + this.of[id].socket.destroy(); + } + } + delete this.of[id]; +} +function serve(path, callback) { + if (typeof path == "function") { + callback = path; + path = false; + } + if (!path) { + this.log("Server path not specified, so defaulting to", "ipc.config.socketRoot + ipc.config.appspace + ipc.config.id", this.config.socketRoot + this.config.appspace + this.config.id); + path = this.config.socketRoot + this.config.appspace + this.config.id; + } + if (!callback) { + callback = emptyCallback; + } + this.server = new Server(path, this.config, log); + this.server.on("start", callback); +} +function emptyCallback() { +} +function serveNet(host, port, UDPType2, callback) { + if (typeof host == "number") { + callback = UDPType2; + UDPType2 = port; + port = host; + host = false; + } + if (typeof host == "function") { + callback = host; + UDPType2 = false; + host = false; + port = false; + } + if (!host) { + this.log("Server host not specified, so defaulting to", "ipc.config.networkHost", this.config.networkHost); + host = this.config.networkHost; + } + if (host.toLowerCase() == "udp4" || host.toLowerCase() == "udp6") { + callback = port; + UDPType2 = host.toLowerCase(); + port = false; + host = this.config.networkHost; + } + if (typeof port == "string") { + callback = UDPType2; + UDPType2 = port; + port = false; + } + if (typeof port == "function") { + callback = port; + UDPType2 = false; + port = false; + } + if (!port) { + this.log("Server port not specified, so defaulting to", "ipc.config.networkPort", this.config.networkPort); + port = this.config.networkPort; + } + if (typeof UDPType2 == "function") { + callback = UDPType2; + UDPType2 = false; + } + if (!callback) { + callback = emptyCallback; + } + this.server = new Server(host, this.config, log, port); + if (UDPType2) { + this.server[UDPType2] = true; + if (UDPType2 === "udp4" && host === "::1") { + this.server.path = "127.0.0.1"; + } + } + this.server.on("start", callback); +} +function connect2(id, path, callback) { + if (typeof path == "function") { + callback = path; + path = false; + } + if (!callback) { + callback = emptyCallback; + } + if (!id) { + this.log("Service id required", "Requested service connection without specifying service id. Aborting connection attempt"); + return; + } + if (!path) { + this.log("Service path not specified, so defaulting to", "ipc.config.socketRoot + ipc.config.appspace + id", (this.config.socketRoot + this.config.appspace + id).data); + path = this.config.socketRoot + this.config.appspace + id; + } + if (this.of[id]) { + if (!this.of[id].socket.destroyed) { + this.log("Already Connected to", id, "- So executing success without connection"); + callback(); + return; + } + this.of[id].socket.destroy(); + } + this.of[id] = new Client(this.config, this.log); + this.of[id].id = id; + this.of[id].socket ? this.of[id].socket.id = id : null; + this.of[id].path = path; + this.of[id].connect(); + callback(this); +} +function connectNet(id, host, port, callback) { + if (!id) { + this.log("Service id required", "Requested service connection without specifying service id. Aborting connection attempt"); + return; + } + if (typeof host == "number") { + callback = port; + port = host; + host = false; + } + if (typeof host == "function") { + callback = host; + host = false; + port = false; + } + if (!host) { + this.log("Server host not specified, so defaulting to", "ipc.config.networkHost", this.config.networkHost); + host = this.config.networkHost; + } + if (typeof port == "function") { + callback = port; + port = false; + } + if (!port) { + this.log("Server port not specified, so defaulting to", "ipc.config.networkPort", this.config.networkPort); + port = this.config.networkPort; + } + if (typeof callback == "string") { + UDPType = callback; + callback = false; + } + if (!callback) { + callback = emptyCallback; + } + if (this.of[id]) { + if (!this.of[id].socket.destroyed) { + this.log("Already Connected to", id, "- So executing success without connection"); + callback(); + return; + } + this.of[id].socket.destroy(); + } + this.of[id] = new Client(this.config, this.log); + this.of[id].id = id; + this.of[id].socket ? this.of[id].socket.id = id : null; + this.of[id].path = host; + this.of[id].port = port; + this.of[id].connect(); + callback(this); +} + +// node-ipc.js +var IPCModule = class extends IPC { + constructor() { + super(); + __publicField(this, "IPC", IPC); + } +}; +var singleton = new IPCModule(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + IPCModule +}); diff --git a/package-lock.json b/package-lock.json index c829f80..30ce369 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,850 +1,55 @@ { "name": "node-ipc", "version": "10.0.2", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "version": "10.0.2", - "license": "MIT", - "dependencies": { - "event-pubsub": "5.0.3", - "js-message": "1.0.7", - "js-queue": "2.0.2", - "strong-type": "^1.0.1" - }, - "devDependencies": { - "c8": "^7.7.3", - "lcov2badge": "^0.1.2", - "node-cmd": "^4.0.0", - "node-http-server": "^8.1.4", - "vanilla-test": "^1.4.8" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.3", - "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", - "dev": true - }, - "node_modules/ansi-colors-es6": { - "version": "5.0.0", - "integrity": "sha512-//DAVWjZto+Mmbm8czZxrwC1/QMi5Ka+c8H6jViO1L3McHYE5YLypSFP44EyrJVzPnTnnxOsjOHjLB262eNoDA==", - "dev": true, - "engines": { - "node": ">=13" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.0", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/byline": { - "version": "4.2.2", - "integrity": "sha1-wgOpilsCkIIqk4anjtosvVvNsy8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/c8": { - "version": "7.7.3", - "integrity": "sha512-ZyA7n3w8i4ETV25tVYMHwJxCSnaOf/LfA8vOcuZOPbonuQfD7tBT/gMWZy7eczRpCDuHcvMXwoqAemg6R0p3+A==", - "dev": true, - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@istanbuljs/schema": "^0.1.2", - "find-up": "^5.0.0", - "foreground-child": "^2.0.0", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-reports": "^3.0.2", - "rimraf": "^3.0.0", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^8.0.0", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.7" - }, - "bin": { - "c8": "bin/c8.js" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "node_modules/convert-source-map": { - "version": "1.8.0", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/copyfiles": { - "version": "2.4.1", - "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", - "dependencies": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^1.0.4", - "noms": "0.0.0", - "through2": "^2.0.1", - "untildify": "^4.0.0", - "yargs": "^16.1.0" - }, - "bin": { - "copyfiles": "copyfiles", - "copyup": "copyfiles" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/dot": { - "version": "1.1.3", - "integrity": "sha512-/nt74Rm+PcfnirXGEdhZleTwGC2LMnuKTeeTIlI82xb5loBBoXNYzr2ezCroPSMtilK8EZIfcNZwOcHN+ib1Lg==", - "dev": true, - "engines": [ - "node >=0.2.6" - ], - "bin": { - "dottojs": "bin/dot-packer" - } - }, - "node_modules/easy-stack": { - "version": "1.0.1", - "integrity": "sha512-wK2sCs4feiiJeFXn3zvY0p41mdU5VUgbgs1rNsc/y5ngFUijdWd+iIN8eoyuZHKB8xN6BL4PdWmzqFmxNg6V2w==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/escalade": { - "version": "3.1.1", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/event-pubsub": { - "version": "5.0.3", - "integrity": "sha512-2QiHxshejKgJrYMzSI9MEHrvhmzxBL+eLyiM5IiyjDBySkgwS2+tdtnO3gbx8pEisu/yOFCIhfCb63gCEu0yBQ==", - "dependencies": { - "copyfiles": "^2.4.0", - "strong-type": "^0.1.3" - }, - "engines": { - "node": ">=13.0.0" - } - }, - "node_modules/event-pubsub/node_modules/strong-type": { - "version": "0.1.6", - "integrity": "sha512-eJe5caH6Pi5oMMeQtIoBPpvNu/s4jiyb63u5tkHNnQXomK+puyQ5i+Z5iTLBr/xUz/pIcps0NSfzzFI34+gAXg==", - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/foreground-child": { - "version": "2.0.0", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob": { - "version": "7.1.7", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/isarray": { - "version": "0.0.1", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "node_modules/isexe": { - "version": "2.0.0", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.0.0", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-reports": { - "version": "3.0.2", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", - "dev": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/js-message": { - "version": "1.0.7", - "integrity": "sha512-efJLHhLjIyKRewNS9EGZ4UpI8NguuL6fKkhRxVuMmrGV2xN/0APGdQYwLFky5w9naebSZ0OwAGp0G6/2Cg90rA==", - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/js-queue": { - "version": "2.0.2", - "integrity": "sha512-pbKLsbCfi7kriM3s1J4DDCo7jQkI58zPLHi0heXPzPlj0hjUsm+FesPUbE0DSbIVIK503A36aUBoCN7eMFedkA==", - "dependencies": { - "easy-stack": "^1.0.1" - }, - "engines": { - "node": ">=1.0.0" - } - }, - "node_modules/lcov2badge": { - "version": "0.1.2", - "integrity": "sha512-kXi1oE5hFfv/l7P4858d8+5FkaNNWTiSn1bi2JRusbyvYNuzxldCRr9YVnyBy/uBLevQxZvamtyN5PdpDpOXzQ==", - "dev": true, - "dependencies": { - "byline": "^4.1.1", - "shields-lightweight": "^0.1.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-cmd": { - "version": "4.0.0", - "integrity": "sha512-3OHy8KI8MuwADyugQRZBsaqe3c0r3yxQSoLsDBVk7vAjPmfG01512MPBQjfmBJxrH+2qURbiBf/ZyoimrhdA6A==", - "dev": true, - "engines": { - "node": ">=6.4.0" - } - }, - "node_modules/node-http-server": { - "version": "8.1.4", - "integrity": "sha512-Td7hM5Ogtzi7p9x50j7vgONoDBBO22fua87njc3E/22/wRc1X9g1xWEv/Gg+at/regZ3eO1vwubfb0gHd2sAgQ==", - "dev": true, - "bin": { - "node-http-server": "bin/nhs.js" - }, - "engines": { - "node": ">=6.5.0" - } - }, - "node_modules/noms": { - "version": "0.0.0", - "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - } - }, - "node_modules/once": { - "version": "1.4.0", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/readable-stream": { - "version": "1.0.34", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/semver": { - "version": "6.3.0", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/shields-lightweight": { - "version": "0.1.0", - "integrity": "sha1-qZj8mDtClhXiPUqBhJJUJIF5V6o=", - "dev": true, - "dependencies": { - "dot": "^1.0.3" - } - }, - "node_modules/signal-exit": { - "version": "3.0.3", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "node_modules/source-map": { - "version": "0.7.3", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/string_decoder": { - "version": "0.10.31", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "node_modules/string-width": { - "version": "4.2.2", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.0", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strong-type": { - "version": "1.0.1", - "integrity": "sha512-K8KEzne00nA5HG3eSIPy44adqGTAMnNlpfvRWtiv8QvRsRm0/rMLHtSoppJ11iFtnmzzpgeYogzdY2YMgrUgOA==", - "engines": { - "node": ">=12.21.0" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/test-exclude": { - "version": "6.0.0", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/through2": { - "version": "2.0.5", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/through2/node_modules/isarray": { - "version": "1.0.0", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.7", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/untildify": { - "version": "4.0.0", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/v8-to-istanbul": { - "version": "8.0.0", - "integrity": "sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/vanilla-test": { - "version": "1.4.8", - "integrity": "sha512-lbTwTQyTd1rKy+q0xEROqAyQX9FzOg1c80/SSLJq84LqQXXfTxE7P5igrWjuaZ8PmozF42SBWeI5b45X+DK9Ow==", - "dev": true, - "dependencies": { - "ansi-colors-es6": "^5.0.0", - "strong-type": "^1.0.1" - }, - "engines": { - "node": ">=12.21.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "node_modules/xtend": { - "version": "4.0.2", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, "dependencies": { "@bcoe/v8-coverage": { "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, "@istanbuljs/schema": { "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true }, "@types/istanbul-lib-coverage": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", "dev": true }, "ansi-colors-es6": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-colors-es6/-/ansi-colors-es6-5.0.0.tgz", + "integrity": "sha512-//DAVWjZto+Mmbm8czZxrwC1/QMi5Ka+c8H6jViO1L3McHYE5YLypSFP44EyrJVzPnTnnxOsjOHjLB262eNoDA==", "dev": true }, "ansi-regex": { - "version": "5.0.0" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { "color-convert": "^2.0.1" } }, "balanced-match": { - "version": "1.0.2" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "brace-expansion": { "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -852,10 +57,14 @@ }, "byline": { "version": "4.2.2", + "resolved": "https://registry.npmjs.org/byline/-/byline-4.2.2.tgz", + "integrity": "sha1-wgOpilsCkIIqk4anjtosvVvNsy8=", "dev": true }, "c8": { "version": "7.7.3", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.7.3.tgz", + "integrity": "sha512-ZyA7n3w8i4ETV25tVYMHwJxCSnaOf/LfA8vOcuZOPbonuQfD7tBT/gMWZy7eczRpCDuHcvMXwoqAemg6R0p3+A==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", @@ -874,6 +83,8 @@ }, "cliui": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -882,18 +93,26 @@ }, "color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.4" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "concat-map": { - "version": "0.0.1" + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "convert-source-map": { "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" @@ -901,6 +120,8 @@ }, "copyfiles": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", "requires": { "glob": "^7.0.5", "minimatch": "^3.0.3", @@ -912,10 +133,14 @@ } }, "core-util-is": { - "version": "1.0.2" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cross-spawn": { "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -925,31 +150,51 @@ }, "dot": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dot/-/dot-1.1.3.tgz", + "integrity": "sha512-/nt74Rm+PcfnirXGEdhZleTwGC2LMnuKTeeTIlI82xb5loBBoXNYzr2ezCroPSMtilK8EZIfcNZwOcHN+ib1Lg==", "dev": true }, "easy-stack": { - "version": "1.0.1" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/easy-stack/-/easy-stack-1.0.1.tgz", + "integrity": "sha512-wK2sCs4feiiJeFXn3zvY0p41mdU5VUgbgs1rNsc/y5ngFUijdWd+iIN8eoyuZHKB8xN6BL4PdWmzqFmxNg6V2w==" }, "emoji-regex": { - "version": "8.0.0" + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "esbuild": { + "version": "0.12.28", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", + "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", + "dev": true }, "escalade": { - "version": "3.1.1" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, "event-pubsub": { "version": "5.0.3", + "resolved": "https://registry.npmjs.org/event-pubsub/-/event-pubsub-5.0.3.tgz", + "integrity": "sha512-2QiHxshejKgJrYMzSI9MEHrvhmzxBL+eLyiM5IiyjDBySkgwS2+tdtnO3gbx8pEisu/yOFCIhfCb63gCEu0yBQ==", "requires": { "copyfiles": "^2.4.0", "strong-type": "^0.1.3" }, "dependencies": { "strong-type": { - "version": "0.1.6" + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/strong-type/-/strong-type-0.1.6.tgz", + "integrity": "sha512-eJe5caH6Pi5oMMeQtIoBPpvNu/s4jiyb63u5tkHNnQXomK+puyQ5i+Z5iTLBr/xUz/pIcps0NSfzzFI34+gAXg==" } } }, "find-up": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { "locate-path": "^6.0.0", @@ -958,6 +203,8 @@ }, "foreground-child": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -965,13 +212,19 @@ } }, "fs.realpath": { - "version": "1.0.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "get-caller-file": { - "version": "2.0.5" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "glob": { "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -983,38 +236,56 @@ }, "has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "html-escaper": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { - "version": "2.0.4" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "is-fullwidth-code-point": { - "version": "3.0.0" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "isarray": { - "version": "0.0.1" + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, "isexe": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "istanbul-lib-coverage": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", "dev": true }, "istanbul-lib-report": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", @@ -1024,6 +295,8 @@ }, "istanbul-reports": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -1031,16 +304,22 @@ } }, "js-message": { - "version": "1.0.7" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.7.tgz", + "integrity": "sha512-efJLHhLjIyKRewNS9EGZ4UpI8NguuL6fKkhRxVuMmrGV2xN/0APGdQYwLFky5w9naebSZ0OwAGp0G6/2Cg90rA==" }, "js-queue": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/js-queue/-/js-queue-2.0.2.tgz", + "integrity": "sha512-pbKLsbCfi7kriM3s1J4DDCo7jQkI58zPLHi0heXPzPlj0hjUsm+FesPUbE0DSbIVIK503A36aUBoCN7eMFedkA==", "requires": { "easy-stack": "^1.0.1" } }, "lcov2badge": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/lcov2badge/-/lcov2badge-0.1.2.tgz", + "integrity": "sha512-kXi1oE5hFfv/l7P4858d8+5FkaNNWTiSn1bi2JRusbyvYNuzxldCRr9YVnyBy/uBLevQxZvamtyN5PdpDpOXzQ==", "dev": true, "requires": { "byline": "^4.1.1", @@ -1049,6 +328,8 @@ }, "locate-path": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { "p-locate": "^5.0.0" @@ -1056,6 +337,8 @@ }, "make-dir": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -1063,23 +346,33 @@ }, "minimatch": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "^1.1.7" } }, "mkdirp": { - "version": "1.0.4" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, "node-cmd": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/node-cmd/-/node-cmd-4.0.0.tgz", + "integrity": "sha512-3OHy8KI8MuwADyugQRZBsaqe3c0r3yxQSoLsDBVk7vAjPmfG01512MPBQjfmBJxrH+2qURbiBf/ZyoimrhdA6A==", "dev": true }, "node-http-server": { "version": "8.1.4", + "resolved": "https://registry.npmjs.org/node-http-server/-/node-http-server-8.1.4.tgz", + "integrity": "sha512-Td7hM5Ogtzi7p9x50j7vgONoDBBO22fua87njc3E/22/wRc1X9g1xWEv/Gg+at/regZ3eO1vwubfb0gHd2sAgQ==", "dev": true }, "noms": { "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", "requires": { "inherits": "^2.0.1", "readable-stream": "~1.0.31" @@ -1087,12 +380,16 @@ }, "once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" } }, "p-limit": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { "yocto-queue": "^0.1.0" @@ -1100,6 +397,8 @@ }, "p-locate": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { "p-limit": "^3.0.2" @@ -1107,20 +406,30 @@ }, "path-exists": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { - "version": "1.0.1" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "process-nextick-args": { - "version": "2.0.1" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "readable-stream": { "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -1129,24 +438,34 @@ } }, "require-directory": { - "version": "2.1.1" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "rimraf": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" } }, "safe-buffer": { - "version": "5.1.2" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "semver": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, "shebang-command": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { "shebang-regex": "^3.0.0" @@ -1154,10 +473,14 @@ }, "shebang-regex": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "shields-lightweight": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/shields-lightweight/-/shields-lightweight-0.1.0.tgz", + "integrity": "sha1-qZj8mDtClhXiPUqBhJJUJIF5V6o=", "dev": true, "requires": { "dot": "^1.0.3" @@ -1165,34 +488,48 @@ }, "signal-exit": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "source-map": { "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true }, - "string_decoder": { - "version": "0.10.31" - }, "string-width": { "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, "strip-ansi": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "requires": { "ansi-regex": "^5.0.0" } }, "strong-type": { - "version": "1.0.1" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strong-type/-/strong-type-1.0.1.tgz", + "integrity": "sha512-K8KEzne00nA5HG3eSIPy44adqGTAMnNlpfvRWtiv8QvRsRm0/rMLHtSoppJ11iFtnmzzpgeYogzdY2YMgrUgOA==" }, "supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -1200,6 +537,8 @@ }, "test-exclude": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { "@istanbuljs/schema": "^0.1.2", @@ -1209,16 +548,22 @@ }, "through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "requires": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" }, "dependencies": { "isarray": { - "version": "1.0.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "readable-stream": { "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -1231,6 +576,8 @@ }, "string_decoder": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" } @@ -1238,13 +585,19 @@ } }, "untildify": { - "version": "4.0.0" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==" }, "util-deprecate": { - "version": "1.0.2" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "v8-to-istanbul": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz", + "integrity": "sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.1", @@ -1254,6 +607,8 @@ }, "vanilla-test": { "version": "1.4.8", + "resolved": "https://registry.npmjs.org/vanilla-test/-/vanilla-test-1.4.8.tgz", + "integrity": "sha512-lbTwTQyTd1rKy+q0xEROqAyQX9FzOg1c80/SSLJq84LqQXXfTxE7P5igrWjuaZ8PmozF42SBWeI5b45X+DK9Ow==", "dev": true, "requires": { "ansi-colors-es6": "^5.0.0", @@ -1262,6 +617,8 @@ }, "which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -1269,6 +626,8 @@ }, "wrap-ansi": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -1276,16 +635,24 @@ } }, "wrappy": { - "version": "1.0.2" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "xtend": { - "version": "4.0.2" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, "y18n": { - "version": "5.0.8" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, "yargs": { "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -1297,10 +664,14 @@ } }, "yargs-parser": { - "version": "20.2.9" + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" }, "yocto-queue": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true } } diff --git a/package.json b/package.json index 651ff4f..4902b99 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "node-ipc", "version": "10.0.2", "description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.", - "type": "module", - "main": "node-ipc.js", + "main": "node-ipc.cjs", + "module": "node-ipc.js", "directories": { "example": "example" }, @@ -18,12 +18,14 @@ }, "devDependencies": { "c8": "^7.7.3", + "esbuild": "^0.12.28", "lcov2badge": "^0.1.2", "node-cmd": "^4.0.0", "node-http-server": "^8.1.4", "vanilla-test": "^1.4.8" }, "scripts": { + "prepublish": "esbuild node-ipc.js --bundle --target=es2018 --platform=node --outfile=node-ipc.cjs", "test": "npm i && c8 -r lcov -r html node test/CI.js && c8 report && node ./lcov.js", "coverage": "echo 'See your coverage report at http://localhost:8080' && node-http-server port=8080 root=./coverage/" }, @@ -59,4 +61,4 @@ "url": "https://github.com/RIAEvangelist/node-ipc/issues" }, "homepage": "http://riaevangelist.github.io/node-ipc/" -} +} \ No newline at end of file From de80f537ef7c50cc364d9712b30314e11c35c496 Mon Sep 17 00:00:00 2001 From: tripodsgames Date: Tue, 14 Sep 2021 21:26:08 -0300 Subject: [PATCH 2/8] Set target to cjs. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4902b99..61e182e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "vanilla-test": "^1.4.8" }, "scripts": { - "prepublish": "esbuild node-ipc.js --bundle --target=es2018 --platform=node --outfile=node-ipc.cjs", + "prepublish": "esbuild node-ipc.js --bundle --format=cjs --target=es2018 --platform=node --outfile=node-ipc.cjs", "test": "npm i && c8 -r lcov -r html node test/CI.js && c8 report && node ./lcov.js", "coverage": "echo 'See your coverage report at http://localhost:8080' && node-http-server port=8080 root=./coverage/" }, From 86292a2babe1b4a16960ce22c730a976ee7aeb18 Mon Sep 17 00:00:00 2001 From: tripodsgames Date: Tue, 14 Sep 2021 21:27:45 -0300 Subject: [PATCH 3/8] Update readme. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0e222f7..4d6d3df 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ A great solution for complex multiprocess **Neural Networking** in Node.JS **npm install node-ipc** +#### for node Date: Tue, 14 Sep 2021 21:29:17 -0300 Subject: [PATCH 4/8] Update gitignore. --- .gitignore | 1 + node-ipc.cjs | 1269 -------------------------------------------------- 2 files changed, 1 insertion(+), 1269 deletions(-) delete mode 100644 node-ipc.cjs diff --git a/.gitignore b/.gitignore index 1ceac24..2a9d810 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /node_modules/ /nbproject npm-debug.log +node-ipc.cjs \ No newline at end of file diff --git a/node-ipc.cjs b/node-ipc.cjs deleted file mode 100644 index 1dd91b2..0000000 --- a/node-ipc.cjs +++ /dev/null @@ -1,1269 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); -var __require = typeof require !== "undefined" ? require : (x) => { - throw new Error('Dynamic require of "' + x + '" is not supported'); -}; -var __commonJS = (cb, mod) => function __require2() { - return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - __markAsModule(target); - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __reExport = (target, module2, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); - } - return target; -}; -var __toModule = (module2) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __publicField = (obj, key, value) => { - __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); - return value; -}; -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; - -// node_modules/js-message/Message.js -var require_Message = __commonJS({ - "node_modules/js-message/Message.js"(exports, module2) { - function Message3() { - Object.defineProperties(this, { - data: { - enumerable: true, - get: getData, - set: setData - }, - type: { - enumerable: true, - get: getType, - set: setType - }, - load: { - enumerable: true, - writable: false, - value: parse - }, - JSON: { - enumerable: true, - get: getJSON - } - }); - var type = ""; - var data = {}; - function getType() { - return type; - } - function getData() { - return data; - } - function getJSON() { - return JSON.stringify({ - type, - data - }); - } - function setType(value) { - type = value; - } - function setData(value) { - data = value; - } - function parse(message) { - try { - var message = JSON.parse(message); - type = message.type; - data = message.data; - } catch (err) { - var badMessage = message; - type = "error", data = { - message: "Invalid JSON response format", - err, - response: badMessage - }; - } - } - } - module2.exports = Message3; - } -}); - -// node_modules/js-queue/queue.js -var require_queue = __commonJS({ - "node_modules/js-queue/queue.js"(exports, module2) { - function Queue2(asStack) { - Object.defineProperties(this, { - add: { - enumerable: true, - writable: false, - value: addToQueue - }, - next: { - enumerable: true, - writable: false, - value: run - }, - clear: { - enumerable: true, - writable: false, - value: clearQueue - }, - contents: { - enumerable: false, - get: getQueue, - set: setQueue - }, - autoRun: { - enumerable: true, - writable: true, - value: true - }, - stop: { - enumerable: true, - writable: true, - value: false - } - }); - var queue = []; - var running = false; - var stop = false; - function clearQueue() { - queue = []; - return queue; - } - function getQueue() { - return queue; - } - function setQueue(val) { - queue = val; - return queue; - } - function addToQueue() { - for (var i in arguments) { - queue.push(arguments[i]); - } - if (!running && !this.stop && this.autoRun) { - this.next(); - } - } - function run() { - running = true; - if (queue.length < 1 || this.stop) { - running = false; - return; - } - queue.shift().bind(this)(); - } - } - module2.exports = Queue2; - } -}); - -// node-ipc.js -__export(exports, { - IPCModule: () => IPCModule, - default: () => singleton -}); - -// entities/Defaults.js -var import_os = __toModule(require("os")); -var Defaults = class { - constructor() { - __publicField(this, "appspace", "app."); - __publicField(this, "socketRoot", "/tmp/"); - __publicField(this, "id", import_os.default.hostname()); - __publicField(this, "encoding", "utf8"); - __publicField(this, "rawBuffer", false); - __publicField(this, "sync", false); - __publicField(this, "unlink", true); - __publicField(this, "delimiter", "\f"); - __publicField(this, "silent", false); - __publicField(this, "logDepth", 5); - __publicField(this, "logInColor", true); - __publicField(this, "logger", console.log.bind(console)); - __publicField(this, "maxConnections", 100); - __publicField(this, "retry", 500); - __publicField(this, "maxRetries", Infinity); - __publicField(this, "stopRetrying", false); - __publicField(this, "IPType", getIPType()); - __publicField(this, "tls", false); - __publicField(this, "networkHost", this.IPType == "IPv6" ? "::1" : "127.0.0.1"); - __publicField(this, "networkPort", 8e3); - __publicField(this, "readableAll", false); - __publicField(this, "writableAll", false); - __publicField(this, "interface", { - localAddress: false, - localPort: false, - family: false, - hints: false, - lookup: false - }); - } -}; -function getIPType() { - const networkInterfaces = import_os.default.networkInterfaces(); - let IPType = ""; - if (networkInterfaces && Array.isArray(networkInterfaces) && networkInterfaces.length > 0) { - IPType = networkInterfaces[Object.keys(networkInterfaces)[0]][0].family; - } - return IPType; -} - -// dao/client.js -var import_net = __toModule(require("net")); -var import_tls = __toModule(require("tls")); - -// entities/EventParser.js -var Parser = class { - constructor(config) { - if (!config) { - config = new Defaults(); - } - this.delimiter = config.delimiter; - } - format(message) { - if (!message.data && message.data !== false && message.data !== 0) { - message.data = {}; - } - if (message.data["_maxListeners"]) { - message.data = {}; - } - message = message.JSON + this.delimiter; - return message; - } - parse(data) { - let events = data.split(this.delimiter); - events.pop(); - return events; - } -}; - -// dao/client.js -var import_js_message = __toModule(require_Message()); -var import_fs = __toModule(require("fs")); -var import_js_queue = __toModule(require_queue()); - -// node_modules/strong-type/index.js -var Fake = class { -}; -var FakeCore = class { -}; -var Is = class { - constructor(strict = true) { - this.strict = strict; - } - throw(valueType, expectedType) { - let err = new TypeError(); - err.message = `expected type of ${valueType} to be ${expectedType}`; - if (!this.strict) { - return false; - } - throw err; - } - typeCheck(value, type) { - if (typeof value === type) { - return true; - } - return this.throw(typeof value, type); - } - instanceCheck(value = new Fake(), constructor = FakeCore) { - if (value instanceof constructor) { - return true; - } - return this.throw(typeof value, constructor.name); - } - symbolStringCheck(value, type) { - if (Object.prototype.toString.call(value) == `[object ${type}]`) { - return true; - } - return this.throw(Object.prototype.toString.call(value), `[object ${type}]`); - } - compare(value, targetValue, typeName) { - if (value == targetValue) { - return true; - } - return this.throw(typeof value, typeName); - } - defined(value) { - const weakIs = new Is(false); - if (weakIs.undefined(value)) { - return this.throw("undefined", "defined"); - } - return true; - } - any(value) { - return this.defined(value); - } - exists(value) { - return this.defined(value); - } - union(value, typesString) { - const types = typesString.split("|"); - const weakIs = new Is(false); - let pass = false; - let type = "undefined"; - for (type of types) { - try { - if (weakIs[type](value)) { - pass = true; - break; - } - } catch (err) { - return this.throw(type, "a method available on strong-type"); - } - } - if (pass) { - return this[type](value); - } - return this.throw(typeof value, types.join("|")); - } - finite(value) { - if (isFinite(value)) { - return true; - } - return this.throw(typeof value, "finite"); - } - NaN(value) { - if (!this.number(value)) { - return this.number(value); - } - if (isNaN(value)) { - return true; - } - return this.throw(typeof value, "NaN"); - } - null(value) { - return this.compare(value, null, "null"); - } - array(value) { - return this.instanceCheck(value, Array); - } - boolean(value) { - return this.typeCheck(value, "boolean"); - } - bigInt(value) { - return this.typeCheck(value, "bigint"); - } - date(value) { - return this.instanceCheck(value, Date); - } - generator(value) { - return this.symbolStringCheck(value, "Generator"); - } - asyncGenerator(value) { - return this.symbolStringCheck(value, "AsyncGenerator"); - } - globalThis(value) { - return this.compare(value, globalThis, "explicitly globalThis, not window, global nor self"); - } - infinity(value) { - return this.compare(value, Infinity, "Infinity"); - } - map(value) { - return this.instanceCheck(value, Map); - } - weakMap(value) { - return this.instanceCheck(value, WeakMap); - } - number(value) { - return this.typeCheck(value, "number"); - } - object(value) { - return this.typeCheck(value, "object"); - } - promise(value) { - return this.instanceCheck(value, Promise); - } - regExp(value) { - return this.instanceCheck(value, RegExp); - } - undefined(value) { - return this.typeCheck(value, "undefined"); - } - set(value) { - return this.instanceCheck(value, Set); - } - weakSet(value) { - return this.instanceCheck(value, WeakSet); - } - string(value) { - return this.typeCheck(value, "string"); - } - symbol(value) { - return this.typeCheck(value, "symbol"); - } - function(value) { - return this.typeCheck(value, "function"); - } - asyncFunction(value) { - return this.symbolStringCheck(value, "AsyncFunction"); - } - generatorFunction(value) { - return this.symbolStringCheck(value, "GeneratorFunction"); - } - asyncGeneratorFunction(value) { - return this.symbolStringCheck(value, "AsyncGeneratorFunction"); - } - error(value) { - return this.instanceCheck(value, Error); - } - evalError(value) { - return this.instanceCheck(value, EvalError); - } - rangeError(value) { - return this.instanceCheck(value, RangeError); - } - referenceError(value) { - return this.instanceCheck(value, ReferenceError); - } - syntaxError(value) { - return this.instanceCheck(value, SyntaxError); - } - typeError(value) { - return this.instanceCheck(value, TypeError); - } - URIError(value) { - return this.instanceCheck(value, URIError); - } - bigInt64Array(value) { - return this.instanceCheck(value, BigInt64Array); - } - bigUint64Array(value) { - return this.instanceCheck(value, BigUint64Array); - } - float32Array(value) { - return this.instanceCheck(value, Float32Array); - } - float64Array(value) { - return this.instanceCheck(value, Float64Array); - } - int8Array(value) { - return this.instanceCheck(value, Int8Array); - } - int16Array(value) { - return this.instanceCheck(value, Int16Array); - } - int32Array(value) { - return this.instanceCheck(value, Int32Array); - } - uint8Array(value) { - return this.instanceCheck(value, Uint8Array); - } - uint8ClampedArray(value) { - return this.instanceCheck(value, Uint8ClampedArray); - } - uint16Array(value) { - return this.instanceCheck(value, Uint16Array); - } - uint32Array(value) { - return this.instanceCheck(value, Uint32Array); - } - arrayBuffer(value) { - return this.instanceCheck(value, ArrayBuffer); - } - dataView(value) { - return this.instanceCheck(value, DataView); - } - sharedArrayBuffer(value) { - return this.instanceCheck(value, function() { - try { - return SharedArrayBuffer; - } catch (e) { - return Fake; - } - }()); - } - intlDateTimeFormat(value) { - return this.instanceCheck(value, Intl.DateTimeFormat); - } - intlCollator(value) { - return this.instanceCheck(value, Intl.Collator); - } - intlDisplayNames(value) { - return this.instanceCheck(value, Intl.DisplayNames); - } - intlListFormat(value) { - return this.instanceCheck(value, Intl.ListFormat); - } - intlLocale(value) { - return this.instanceCheck(value, Intl.Locale); - } - intlNumberFormat(value) { - return this.instanceCheck(value, Intl.NumberFormat); - } - intlPluralRules(value) { - return this.instanceCheck(value, Intl.PluralRules); - } - intlRelativeTimeFormat(value) { - return this.instanceCheck(value, Intl.RelativeTimeFormat); - } - intlRelativeTimeFormat(value) { - return this.instanceCheck(value, Intl.RelativeTimeFormat); - } - finalizationRegistry(value) { - return this.instanceCheck(value, FinalizationRegistry); - } - weakRef(value) { - return this.instanceCheck(value, WeakRef); - } -}; - -// node_modules/event-pubsub/index.js -var is = new Is(); -var _handleOnce, _all, _once, _events; -var EventPubSub = class { - constructor() { - __privateAdd(this, _handleOnce, (type, handlers, ...args) => { - is.string(type); - is.array(handlers); - const deleteOnceHandled = []; - for (let handler of handlers) { - handler(...args); - if (handler[__privateGet(this, _once)]) { - deleteOnceHandled.push(handler); - } - } - for (let handler of deleteOnceHandled) { - this.off(type, handler); - } - }); - __privateAdd(this, _all, Symbol.for("event-pubsub-all")); - __privateAdd(this, _once, Symbol.for("event-pubsub-once")); - __privateAdd(this, _events, {}); - } - on(type, handler, once = false) { - is.string(type); - is.function(handler); - is.boolean(once); - if (type == "*") { - type = __privateGet(this, _all); - } - if (!__privateGet(this, _events)[type]) { - __privateGet(this, _events)[type] = []; - } - handler[__privateGet(this, _once)] = once; - __privateGet(this, _events)[type].push(handler); - return this; - } - once(type, handler) { - return this.on(type, handler, true); - } - off(type = "*", handler = "*") { - is.string(type); - if (type == __privateGet(this, _all).toString() || type == "*") { - type = __privateGet(this, _all); - } - if (!__privateGet(this, _events)[type]) { - return this; - } - if (handler == "*") { - delete __privateGet(this, _events)[type]; - return this; - } - is.function(handler); - const handlers = __privateGet(this, _events)[type]; - while (handlers.includes(handler)) { - handlers.splice(handlers.indexOf(handler), 1); - } - if (handlers.length < 1) { - delete __privateGet(this, _events)[type]; - } - return this; - } - emit(type, ...args) { - is.string(type); - const globalHandlers = __privateGet(this, _events)[__privateGet(this, _all)] || []; - __privateGet(this, _handleOnce).call(this, __privateGet(this, _all).toString(), globalHandlers, type, ...args); - if (!__privateGet(this, _events)[type]) { - return this; - } - const handlers = __privateGet(this, _events)[type]; - __privateGet(this, _handleOnce).call(this, type, handlers, ...args); - return this; - } - reset() { - this.off(__privateGet(this, _all).toString()); - for (let type in __privateGet(this, _events)) { - this.off(type); - } - return this; - } - get list() { - return Object.assign({}, __privateGet(this, _events)); - } -}; -_handleOnce = new WeakMap(); -_all = new WeakMap(); -_once = new WeakMap(); -_events = new WeakMap(); - -// dao/client.js -var eventParser = new Parser(); -var Client = class extends EventPubSub { - constructor(config, log2) { - super(); - __publicField(this, "Client", Client); - __publicField(this, "queue", new import_js_queue.default()); - __publicField(this, "socket", false); - __publicField(this, "connect", connect); - __publicField(this, "emit", emit); - __publicField(this, "retriesRemaining", 0); - __publicField(this, "explicitlyDisconnected", false); - this.config = config; - this.log = log2; - this.publish = super.emit; - config.maxRetries ? this.retriesRemaining = config.maxRetries : 0; - eventParser = new Parser(this.config); - } -}; -function emit(type, data) { - this.log("dispatching event to ", this.id, this.path, " : ", type, ",", data); - let message = new import_js_message.default(); - message.type = type; - message.data = data; - if (this.config.rawBuffer) { - message = Buffer.from(type, this.config.encoding); - } else { - message = eventParser.format(message); - } - if (!this.config.sync) { - this.socket.write(message); - return; - } - this.queue.add(syncEmit.bind(this, message)); -} -function syncEmit(message) { - this.log("dispatching event to ", this.id, this.path, " : ", message); - this.socket.write(message); -} -function connect() { - let client = this; - client.log("requested connection to ", client.id, client.path); - if (!this.path) { - client.log("\n\n######\nerror: ", client.id, " client has not specified socket path it wishes to connect to."); - return; - } - const options = {}; - if (!client.port) { - client.log("Connecting client on Unix Socket :", client.path); - options.path = client.path; - if (process.platform === "win32" && !client.path.startsWith("\\\\.\\pipe\\")) { - options.path = options.path.replace(/^\//, ""); - options.path = options.path.replace(/\//g, "-"); - options.path = `\\\\.\\pipe\\${options.path}`; - } - client.socket = import_net.default.connect(options); - } else { - options.host = client.path; - options.port = client.port; - if (client.config.interface.localAddress) { - options.localAddress = client.config.interface.localAddress; - } - if (client.config.interface.localPort) { - options.localPort = client.config.interface.localPort; - } - if (client.config.interface.family) { - options.family = client.config.interface.family; - } - if (client.config.interface.hints) { - options.hints = client.config.interface.hints; - } - if (client.config.interface.lookup) { - options.lookup = client.config.interface.lookup; - } - if (!client.config.tls) { - client.log("Connecting client via TCP to", options); - client.socket = import_net.default.connect(options); - } else { - client.log("Connecting client via TLS to", client.path, client.port, client.config.tls); - if (client.config.tls.private) { - client.config.tls.key = import_fs.default.readFileSync(client.config.tls.private); - } - if (client.config.tls.public) { - client.config.tls.cert = import_fs.default.readFileSync(client.config.tls.public); - } - if (client.config.tls.trustedConnections) { - if (typeof client.config.tls.trustedConnections === "string") { - client.config.tls.trustedConnections = [client.config.tls.trustedConnections]; - } - client.config.tls.ca = []; - for (let i = 0; i < client.config.tls.trustedConnections.length; i++) { - client.config.tls.ca.push(import_fs.default.readFileSync(client.config.tls.trustedConnections[i])); - } - } - Object.assign(client.config.tls, options); - client.socket = import_tls.default.connect(client.config.tls); - } - } - client.socket.setEncoding(this.config.encoding); - client.socket.on("error", function(err) { - client.log("\n\n######\nerror: ", err); - client.publish("error", err); - }); - client.socket.on("connect", function connectionMade() { - client.publish("connect"); - client.retriesRemaining = client.config.maxRetries; - client.log("retrying reset"); - }); - client.socket.on("close", function connectionClosed() { - client.log("connection closed", client.id, client.path, client.retriesRemaining, "tries remaining of", client.config.maxRetries); - if (client.config.stopRetrying || client.retriesRemaining < 1 || client.explicitlyDisconnected) { - client.publish("disconnect"); - client.log(client.config.id, "exceeded connection rety amount of", " or stopRetrying flag set."); - client.socket.destroy(); - client.publish("destroy"); - client = void 0; - return; - } - setTimeout(function retryTimeout() { - if (client.explicitlyDisconnected) { - return; - } - client.retriesRemaining--; - client.connect(); - }.bind(null, client), client.config.retry); - client.publish("disconnect"); - }); - client.socket.on("data", function(data) { - client.log("## received events ##"); - if (client.config.rawBuffer) { - client.publish("data", Buffer.from(data, client.config.encoding)); - if (!client.config.sync) { - return; - } - client.queue.next(); - return; - } - if (!this.ipcBuffer) { - this.ipcBuffer = ""; - } - data = this.ipcBuffer += data; - if (data.slice(-1) != eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1) { - client.log("Messages are large, You may want to consider smaller messages."); - return; - } - this.ipcBuffer = ""; - const events = eventParser.parse(data); - const eCount = events.length; - for (let i = 0; i < eCount; i++) { - let message = new import_js_message.default(); - message.load(events[i]); - client.log("detected event", message.type, message.data); - client.publish(message.type, message.data); - } - if (!client.config.sync) { - return; - } - client.queue.next(); - }); -} - -// dao/socketServer.js -var import_net2 = __toModule(require("net")); -var import_tls2 = __toModule(require("tls")); -var import_fs2 = __toModule(require("fs")); -var import_dgram = __toModule(require("dgram")); -var import_js_message2 = __toModule(require_Message()); -var eventParser2 = new Parser(); -var Server = class extends EventPubSub { - constructor(path, config, log2, port) { - super(); - __publicField(this, "udp4", false); - __publicField(this, "udp6", false); - __publicField(this, "server", false); - __publicField(this, "sockets", []); - __publicField(this, "emit", emit2); - __publicField(this, "broadcast", broadcast); - this.config = config; - this.path = path; - this.port = port; - this.log = log2; - this.publish = super.emit; - eventParser2 = new Parser(this.config); - this.on("close", serverClosed.bind(this)); - } - onStart(socket) { - this.publish("start", socket); - } - stop() { - this.server.close(); - } - start() { - if (!this.path) { - this.log("Socket Server Path not specified, refusing to start"); - return; - } - if (this.config.unlink) { - import_fs2.default.unlink(this.path, startServer.bind(this)); - } else { - startServer.bind(this)(); - } - } -}; -function emit2(socket, type, data) { - this.log("dispatching event to socket", " : ", type, data); - let message = new import_js_message2.default(); - message.type = type; - message.data = data; - if (this.config.rawBuffer) { - this.log(this.config.encoding); - message = Buffer.from(type, this.config.encoding); - } else { - message = eventParser2.format(message); - } - if (this.udp4 || this.udp6) { - if (!socket.address || !socket.port) { - this.log("Attempting to emit to a single UDP socket without supplying socket address or port. Redispatching event as broadcast to all connected sockets"); - this.broadcast(type, data); - return; - } - this.server.write(message, socket); - return; - } - socket.write(message); -} -function broadcast(type, data) { - this.log("broadcasting event to all known sockets listening to ", this.path, " : ", this.port ? this.port : "", type, data); - let message = new import_js_message2.default(); - message.type = type; - message.data = data; - if (this.config.rawBuffer) { - message = Buffer.from(type, this.config.encoding); - } else { - message = eventParser2.format(message); - } - if (this.udp4 || this.udp6) { - for (let i = 1, count = this.sockets.length; i < count; i++) { - this.server.write(message, this.sockets[i]); - } - } else { - for (let i = 0, count = this.sockets.length; i < count; i++) { - this.sockets[i].write(message); - } - } -} -function serverClosed() { - for (let i = 0, count = this.sockets.length; i < count; i++) { - let socket = this.sockets[i]; - let destroyedSocketId = false; - if (socket) { - if (socket.readable) { - continue; - } - } - if (socket.id) { - destroyedSocketId = socket.id; - } - this.log("socket disconnected", destroyedSocketId.toString()); - if (socket && socket.destroy) { - socket.destroy(); - } - this.sockets.splice(i, 1); - this.publish("socket.disconnected", socket, destroyedSocketId); - return; - } -} -function gotData(socket, data, UDPSocket) { - let sock = this.udp4 || this.udp6 ? UDPSocket : socket; - if (this.config.rawBuffer) { - data = Buffer.from(data, this.config.encoding); - this.publish("data", data, sock); - return; - } - if (!sock.ipcBuffer) { - sock.ipcBuffer = ""; - } - data = sock.ipcBuffer += data; - if (data.slice(-1) != eventParser2.delimiter || data.indexOf(eventParser2.delimiter) == -1) { - this.log("Messages are large, You may want to consider smaller messages."); - return; - } - sock.ipcBuffer = ""; - data = eventParser2.parse(data); - while (data.length > 0) { - let message = new import_js_message2.default(); - message.load(data.shift()); - if (message.data && message.data.id) { - sock.id = message.data.id; - } - this.log("received event of : ", message.type, message.data); - this.publish(message.type, message.data, sock); - } -} -function socketClosed(socket) { - this.publish("close", socket); -} -function serverCreated(socket) { - this.sockets.push(socket); - if (socket.setEncoding) { - socket.setEncoding(this.config.encoding); - } - this.log("## socket connection to server detected ##"); - socket.on("close", socketClosed.bind(this)); - socket.on("error", function(err) { - this.log("server socket error", err); - this.publish("error", err); - }.bind(this)); - socket.on("data", gotData.bind(this, socket)); - socket.on("message", function(msg, rinfo) { - if (!rinfo) { - return; - } - this.log("Received UDP message from ", rinfo.address, rinfo.port); - let data; - if (this.config.rawSocket) { - data = Buffer.from(msg, this.config.encoding); - } else { - data = msg.toString(); - } - socket.emit("data", data, rinfo); - }.bind(this)); - this.publish("connect", socket); - if (this.config.rawBuffer) { - return; - } -} -function startServer() { - this.log("starting server on ", this.path, this.port ? `:${this.port}` : ""); - if (!this.udp4 && !this.udp6) { - this.log("starting TLS server", this.config.tls); - if (!this.config.tls) { - this.server = import_net2.default.createServer(serverCreated.bind(this)); - } else { - startTLSServer.bind(this)(); - } - } else { - this.server = import_dgram.default.createSocket(this.udp4 ? "udp4" : "udp6"); - this.server.write = UDPWrite.bind(this); - this.server.on("listening", function UDPServerStarted() { - serverCreated.bind(this)(this.server); - }.bind(this)); - } - this.server.on("error", function(err) { - this.log("server error", err); - this.publish("error", err); - }.bind(this)); - this.server.maxConnections = this.config.maxConnections; - if (!this.port) { - this.log("starting server as", "Unix || Windows Socket"); - if (process.platform === "win32") { - this.path = this.path.replace(/^\//, ""); - this.path = this.path.replace(/\//g, "-"); - this.path = `\\\\.\\pipe\\${this.path}`; - } - this.server.listen({ - path: this.path, - readableAll: this.config.readableAll, - writableAll: this.config.writableAll - }, this.onStart.bind(this)); - return; - } - if (!this.udp4 && !this.udp6) { - this.log("starting server as", this.config.tls ? "TLS" : "TCP"); - this.server.listen(this.port, this.path, this.onStart.bind(this)); - return; - } - this.log("starting server as", this.udp4 ? "udp4" : "udp6"); - this.server.bind(this.port, this.path); - this.onStart({ - address: this.path, - port: this.port - }); -} -function startTLSServer() { - this.log("starting TLS server", this.config.tls); - if (this.config.tls.private) { - this.config.tls.key = import_fs2.default.readFileSync(this.config.tls.private); - } else { - this.config.tls.key = import_fs2.default.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`); - } - if (this.config.tls.public) { - this.config.tls.cert = import_fs2.default.readFileSync(this.config.tls.public); - } else { - this.config.tls.cert = import_fs2.default.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`); - } - if (this.config.tls.dhparam) { - this.config.tls.dhparam = import_fs2.default.readFileSync(this.config.tls.dhparam); - } - if (this.config.tls.trustedConnections) { - if (typeof this.config.tls.trustedConnections === "string") { - this.config.tls.trustedConnections = [this.config.tls.trustedConnections]; - } - this.config.tls.ca = []; - for (let i = 0; i < this.config.tls.trustedConnections.length; i++) { - this.config.tls.ca.push(import_fs2.default.readFileSync(this.config.tls.trustedConnections[i])); - } - } - this.server = import_tls2.default.createServer(this.config.tls, serverCreated.bind(this)); -} -function UDPWrite(message, socket) { - let data = Buffer.from(message, this.config.encoding); - this.server.send(data, 0, data.length, socket.port, socket.address, function(err, bytes) { - if (err) { - this.log("error writing data to socket", err); - this.publish("error", function(err2) { - this.publish("error", err2); - }); - } - }); -} - -// services/IPC.js -var import_util = __toModule(require("util")); -var IPC = class { - constructor() { - __publicField(this, "config", new Defaults()); - __publicField(this, "of", {}); - __publicField(this, "server", false); - } - get connectTo() { - return connect2; - } - get connectToNet() { - return connectNet; - } - get disconnect() { - return disconnect; - } - get serve() { - return serve; - } - get serveNet() { - return serveNet; - } - get log() { - return log; - } - set connectTo(value) { - return connect2; - } - set connectToNet(value) { - return connectNet; - } - set disconnect(value) { - return disconnect; - } - set serve(value) { - return serve; - } - set serveNet(value) { - return serveNet; - } - set log(value) { - return log; - } -}; -function log(...args) { - if (this.config.silent) { - return; - } - for (let i = 0, count = args.length; i < count; i++) { - if (typeof args[i] != "object") { - continue; - } - args[i] = import_util.default.inspect(args[i], { - depth: this.config.logDepth, - colors: this.config.logInColor - }); - } - this.config.logger(args.join(" ")); -} -function disconnect(id) { - if (!this.of[id]) { - return; - } - this.of[id].explicitlyDisconnected = true; - this.of[id].off("*", "*"); - if (this.of[id].socket) { - if (this.of[id].socket.destroy) { - this.of[id].socket.destroy(); - } - } - delete this.of[id]; -} -function serve(path, callback) { - if (typeof path == "function") { - callback = path; - path = false; - } - if (!path) { - this.log("Server path not specified, so defaulting to", "ipc.config.socketRoot + ipc.config.appspace + ipc.config.id", this.config.socketRoot + this.config.appspace + this.config.id); - path = this.config.socketRoot + this.config.appspace + this.config.id; - } - if (!callback) { - callback = emptyCallback; - } - this.server = new Server(path, this.config, log); - this.server.on("start", callback); -} -function emptyCallback() { -} -function serveNet(host, port, UDPType2, callback) { - if (typeof host == "number") { - callback = UDPType2; - UDPType2 = port; - port = host; - host = false; - } - if (typeof host == "function") { - callback = host; - UDPType2 = false; - host = false; - port = false; - } - if (!host) { - this.log("Server host not specified, so defaulting to", "ipc.config.networkHost", this.config.networkHost); - host = this.config.networkHost; - } - if (host.toLowerCase() == "udp4" || host.toLowerCase() == "udp6") { - callback = port; - UDPType2 = host.toLowerCase(); - port = false; - host = this.config.networkHost; - } - if (typeof port == "string") { - callback = UDPType2; - UDPType2 = port; - port = false; - } - if (typeof port == "function") { - callback = port; - UDPType2 = false; - port = false; - } - if (!port) { - this.log("Server port not specified, so defaulting to", "ipc.config.networkPort", this.config.networkPort); - port = this.config.networkPort; - } - if (typeof UDPType2 == "function") { - callback = UDPType2; - UDPType2 = false; - } - if (!callback) { - callback = emptyCallback; - } - this.server = new Server(host, this.config, log, port); - if (UDPType2) { - this.server[UDPType2] = true; - if (UDPType2 === "udp4" && host === "::1") { - this.server.path = "127.0.0.1"; - } - } - this.server.on("start", callback); -} -function connect2(id, path, callback) { - if (typeof path == "function") { - callback = path; - path = false; - } - if (!callback) { - callback = emptyCallback; - } - if (!id) { - this.log("Service id required", "Requested service connection without specifying service id. Aborting connection attempt"); - return; - } - if (!path) { - this.log("Service path not specified, so defaulting to", "ipc.config.socketRoot + ipc.config.appspace + id", (this.config.socketRoot + this.config.appspace + id).data); - path = this.config.socketRoot + this.config.appspace + id; - } - if (this.of[id]) { - if (!this.of[id].socket.destroyed) { - this.log("Already Connected to", id, "- So executing success without connection"); - callback(); - return; - } - this.of[id].socket.destroy(); - } - this.of[id] = new Client(this.config, this.log); - this.of[id].id = id; - this.of[id].socket ? this.of[id].socket.id = id : null; - this.of[id].path = path; - this.of[id].connect(); - callback(this); -} -function connectNet(id, host, port, callback) { - if (!id) { - this.log("Service id required", "Requested service connection without specifying service id. Aborting connection attempt"); - return; - } - if (typeof host == "number") { - callback = port; - port = host; - host = false; - } - if (typeof host == "function") { - callback = host; - host = false; - port = false; - } - if (!host) { - this.log("Server host not specified, so defaulting to", "ipc.config.networkHost", this.config.networkHost); - host = this.config.networkHost; - } - if (typeof port == "function") { - callback = port; - port = false; - } - if (!port) { - this.log("Server port not specified, so defaulting to", "ipc.config.networkPort", this.config.networkPort); - port = this.config.networkPort; - } - if (typeof callback == "string") { - UDPType = callback; - callback = false; - } - if (!callback) { - callback = emptyCallback; - } - if (this.of[id]) { - if (!this.of[id].socket.destroyed) { - this.log("Already Connected to", id, "- So executing success without connection"); - callback(); - return; - } - this.of[id].socket.destroy(); - } - this.of[id] = new Client(this.config, this.log); - this.of[id].id = id; - this.of[id].socket ? this.of[id].socket.id = id : null; - this.of[id].path = host; - this.of[id].port = port; - this.of[id].connect(); - callback(this); -} - -// node-ipc.js -var IPCModule = class extends IPC { - constructor() { - super(); - __publicField(this, "IPC", IPC); - } -}; -var singleton = new IPCModule(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - IPCModule -}); From 144178f02183948422339e63a1836a3de7dfd6ee Mon Sep 17 00:00:00 2001 From: tripodsgames Date: Tue, 14 Sep 2021 21:31:03 -0300 Subject: [PATCH 5/8] Fixed deprecated prepublish script. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 61e182e..52c57e5 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "vanilla-test": "^1.4.8" }, "scripts": { - "prepublish": "esbuild node-ipc.js --bundle --format=cjs --target=es2018 --platform=node --outfile=node-ipc.cjs", + "prepare": "esbuild node-ipc.js --bundle --format=cjs --target=es2018 --platform=node --outfile=node-ipc.cjs", "test": "npm i && c8 -r lcov -r html node test/CI.js && c8 report && node ./lcov.js", "coverage": "echo 'See your coverage report at http://localhost:8080' && node-http-server port=8080 root=./coverage/" }, @@ -61,4 +61,4 @@ "url": "https://github.com/RIAEvangelist/node-ipc/issues" }, "homepage": "http://riaevangelist.github.io/node-ipc/" -} \ No newline at end of file +} From 486c3138d21a8030322ade946bbd933bad6a8876 Mon Sep 17 00:00:00 2001 From: Brandon Nozaki Miller Date: Wed, 15 Sep 2021 06:38:43 -0700 Subject: [PATCH 6/8] updating version for cjs support --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52c57e5..2c6201e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-ipc", - "version": "10.0.2", + "version": "10.1.0", "description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.", "main": "node-ipc.cjs", "module": "node-ipc.js", From 98c6fc8140ea4b8dc85282fd152e679c57147a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ant=C3=B4nio=20Posso=20da=20Silva?= Date: Wed, 15 Sep 2021 10:54:49 -0300 Subject: [PATCH 7/8] Update README.md Improvements to README. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4d6d3df..7d204fa 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ node-ipc A great solution for complex multiprocess **Neural Networking** in Node.JS -**npm install node-ipc** +`npm install node-ipc` #### for node Date: Wed, 15 Sep 2021 11:06:48 -0300 Subject: [PATCH 8/8] Fix ESM and Commonjs compatibility. --- package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c6201e..12550da 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,13 @@ "name": "node-ipc", "version": "10.1.0", "description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.", + "type": "module", "main": "node-ipc.cjs", "module": "node-ipc.js", + "exports": { + "import": "./node-ipc.js", + "require": "./node-ipc.cjs" + }, "directories": { "example": "example" }, @@ -61,4 +66,4 @@ "url": "https://github.com/RIAEvangelist/node-ipc/issues" }, "homepage": "http://riaevangelist.github.io/node-ipc/" -} +} \ No newline at end of file