From cb10ca16d18867824cce2c67d08575ef5da90100 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 20 May 2022 23:40:56 +1000 Subject: [PATCH 01/26] Migrate package to ESM --- .mocharc.json | 4 + karma-live-data.conf.js | 16 - karma.conf.cjs | 28 + karma.conf.js | 46 - package-lock.json | 1698 +-------------------------- package.json | 32 +- src/lib/crypto.ts | 2 +- src/lib/discovery/dns.ts | 2 +- src/lib/discovery/enrtree.ts | 2 +- src/lib/discovery/fetch_nodes.ts | 2 +- src/lib/waku_light_push/push_rpc.ts | 4 +- src/lib/waku_message/index.ts | 3 +- src/lib/waku_store/history_rpc.ts | 4 +- tsconfig.json | 6 +- webpack.config.bundle.cjs | 40 + webpack.config.bundle.js | 38 - webpack.config.cjs | 50 + webpack.config.js | 44 - webpack.config.min.bundle.cjs | 40 + webpack.config.min.bundle.js | 38 - webpack.config.min.cjs | 46 + webpack.config.min.js | 44 - 22 files changed, 277 insertions(+), 1912 deletions(-) delete mode 100644 karma-live-data.conf.js create mode 100644 karma.conf.cjs delete mode 100644 karma.conf.js create mode 100644 webpack.config.bundle.cjs delete mode 100644 webpack.config.bundle.js create mode 100644 webpack.config.cjs delete mode 100644 webpack.config.js create mode 100644 webpack.config.min.bundle.cjs delete mode 100644 webpack.config.min.bundle.js create mode 100644 webpack.config.min.cjs delete mode 100644 webpack.config.min.js diff --git a/.mocharc.json b/.mocharc.json index dece11d531..ab845eb766 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -2,5 +2,9 @@ "extension": ["ts"], "spec": "src/**/*.spec.ts", "require": ["ts-node/register", "isomorphic-fetch", "jsdom-global/register"], + "node-option": [ + "experimental-specifier-resolution=node", + "loader=ts-node/esm" + ], "exit": true } diff --git a/karma-live-data.conf.js b/karma-live-data.conf.js deleted file mode 100644 index 114ee6ff7b..0000000000 --- a/karma-live-data.conf.js +++ /dev/null @@ -1,16 +0,0 @@ -// import settings from default config file -let properties = null; -const originalConfigFn = require("./karma.conf.js"); -originalConfigFn({ - set: function (arg) { - properties = arg; - }, -}); - -// pass `--grep '[live data]'` to mocha to only run live data tests -properties.client.args = ["--grep", "[live data]]"]; - -// export settings -module.exports = function (config) { - config.set(properties); -}; diff --git a/karma.conf.cjs b/karma.conf.cjs new file mode 100644 index 0000000000..16ff72e5a1 --- /dev/null +++ b/karma.conf.cjs @@ -0,0 +1,28 @@ +process.env.CHROME_BIN = require("puppeteer").executablePath(); +const webpackConfig = require("./webpack.config.cjs"); + +module.exports = function (config) { + config.set({ + frameworks: ["webpack", "mocha"], + files: ["src/lib/**/!(node).spec.ts"], + preprocessors: { + "src/lib/**/!(node).spec.ts": ["env", "webpack"], + }, + envPreprocessor: ["CI"], + reporters: ["progress"], + browsers: ["ChromeHeadless"], + singleRun: true, + client: { + mocha: { + timeout: 6000, // Default is 2s + }, + }, + webpack: { + mode: "production", + module: webpackConfig.module, + plugins: webpackConfig.plugins, + resolve: webpackConfig.resolve, + stats: { warnings: false }, + }, + }); +}; diff --git a/karma.conf.js b/karma.conf.js deleted file mode 100644 index 2c2de03117..0000000000 --- a/karma.conf.js +++ /dev/null @@ -1,46 +0,0 @@ -process.env.CHROME_BIN = require("puppeteer").executablePath(); - -module.exports = function (config) { - config.set({ - frameworks: ["mocha", "karma-typescript"], - files: ["src/lib/**/*.ts", "src/proto/**/*.ts"], - preprocessors: { - "**/*.ts": ["karma-typescript", "env"], - }, - envPreprocessor: ["CI"], - plugins: [ - require("karma-mocha"), - require("karma-typescript"), - require("karma-chrome-launcher"), - require("karma-env-preprocessor"), - ], - reporters: ["progress", "karma-typescript"], - browsers: ["ChromeHeadless"], - singleRun: true, - client: { - mocha: { - timeout: 6000, // Default is 2s - }, - }, - karmaTypescriptConfig: { - bundlerOptions: { - entrypoints: /^.*[^(node)]\.spec\.ts$/, - }, - coverageOptions: { - instrumentation: false, - }, - tsconfig: "./tsconfig.json", - compilerOptions: { - noEmit: false, - }, - include: { - mode: "replace", - values: ["src/lib/**/*.ts", "src/proto/**/*.ts"], - }, - exclude: { - mode: "replace", - values: ["node_modules/**"], - }, - }, - }); -}; diff --git a/package-lock.json b/package-lock.json index 57ba88d9f0..a18bf3706d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,6 +61,7 @@ "fast-check": "^2.14.0", "gh-pages": "^3.2.3", "husky": "^7.0.4", + "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "jsdom": "^19.0.0", "jsdom-global": "^3.0.2", @@ -68,7 +69,7 @@ "karma-chrome-launcher": "^3.1.0", "karma-env-preprocessor": "^0.1.1", "karma-mocha": "^2.0.1", - "karma-typescript": "^5.5.3", + "karma-webpack": "^5.0.0", "lint-staged": "^12.3.4", "mocha": "^9.1.3", "npm-run-all": "^4.1.5", @@ -2472,30 +2473,6 @@ "safer-buffer": "~2.1.0" } }, - "node_modules/asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/assert": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", - "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", - "dev": true, - "dependencies": { - "es6-object-assign": "^1.1.0", - "is-nan": "^1.2.1", - "object-is": "^1.0.1", - "util": "^0.12.0" - } - }, "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -2536,18 +2513,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, - "node_modules/available-typed-arrays": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz", - "integrity": "sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -2638,12 +2603,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "node_modules/body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -2753,138 +2712,18 @@ "node": ">=8" } }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, "node_modules/browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "node_modules/browser-resolve": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", - "dev": true, - "dependencies": { - "resolve": "^1.17.0" - } - }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "dependencies": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/browserify-rsa/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, - "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "node_modules/browserify-sign/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, - "node_modules/browserify-sign/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "dependencies": { - "pako": "~1.0.5" - } - }, "node_modules/browserslist": { "version": "4.16.7", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.7.tgz", @@ -2946,18 +2785,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "node_modules/builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, "node_modules/bytes-iec": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", @@ -3119,16 +2946,6 @@ "integrity": "sha512-CLOGsVDrVamzv8sXJGaILUVI6dsuAkouJP/n6t+OxLPeeA4DDby7zn9SB6EUpa1H7oIKoE+rMmkW80zYsFfUjA==", "dev": true }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "node_modules/class-is": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", @@ -3232,15 +3049,6 @@ "node": ">=8" } }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -3288,24 +3096,6 @@ "node": ">=0.1.90" } }, - "node_modules/combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", - "dev": true, - "dependencies": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - } - }, - "node_modules/combine-source-map/node_modules/convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3406,18 +3196,6 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, "node_modules/content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -3479,43 +3257,6 @@ "node": ">=10" } }, - "node_modules/create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -3544,28 +3285,6 @@ "node": ">= 8" } }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "engines": { - "node": "*" - } - }, "node_modules/crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -4030,15 +3749,6 @@ "node": ">=8" } }, - "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "dependencies": { - "clone": "^1.0.2" - } - }, "node_modules/define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -4076,16 +3786,6 @@ "node": ">= 0.6" } }, - "node_modules/des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "node_modules/devtools-protocol": { "version": "0.0.960912", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.960912.tgz", @@ -4107,17 +3807,6 @@ "node": ">=0.3.1" } }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4200,18 +3889,6 @@ "void-elements": "^2.0.0" } }, - "node_modules/domain-browser": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.19.0.tgz", - "integrity": "sha512-fRA+BaAWOR/yr/t7T9E9GJztHPeFjj8U35ajyAjCDtAAnTn1Rc1f6W6VGPJrO1tkQv9zWu+JRof7z6oQtiYVFQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://bevry.me/fund" - } - }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -4279,21 +3956,6 @@ "integrity": "sha512-NteznMlGtkIZCJNM2X6AVm3oMqWAdq7TjqagZhmVLPwd9mtrIq+rRxGHerjFAOFIqQJYQUMT72ncd/lVcH1cOw==", "dev": true }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "node_modules/email-addresses": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", @@ -4506,12 +4168,6 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "node_modules/es6-object-assign": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", - "dev": true - }, "node_modules/es6-promisify": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-7.0.0.tgz", @@ -5130,16 +4786,6 @@ "node": ">=0.8.x" } }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -5462,12 +5108,6 @@ } } }, - "node_modules/foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -5964,50 +5604,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash-base/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "node_modules/hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", @@ -6052,17 +5648,6 @@ "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==" }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -6129,12 +5714,6 @@ "npm": ">=1.3.7" } }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, "node_modules/https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -6210,6 +5789,12 @@ "node": ">= 4" } }, + "node_modules/ignore-loader": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ignore-loader/-/ignore-loader-0.1.2.tgz", + "integrity": "sha1-2B8kA3bQuk8Nd4lyw60lh0EXpGM=", + "dev": true + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -6289,15 +5874,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "node_modules/inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "dev": true, - "dependencies": { - "source-map": "~0.5.3" - } - }, "node_modules/interface-datastore": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-6.1.0.tgz", @@ -6373,21 +5949,6 @@ "stream-to-it": "^0.2.2" } }, - "node_modules/is-arguments": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", - "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -6492,18 +6053,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-generator-function": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz", - "integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -6532,22 +6081,6 @@ "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" }, - "node_modules/is-nan": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", - "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -6679,25 +6212,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typed-array": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz", - "integrity": "sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -7384,119 +6898,30 @@ "minimist": "^1.2.3" } }, - "node_modules/karma-typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.3.tgz", - "integrity": "sha512-l1FHurolXEBIzRa9ExpNtjzysAhsi/vLpTazpwLHWWK86mknvVpqor6pRZ5Nid7jvOPrTBqAq0JRuLgiCdRkFw==", + "node_modules/karma-webpack": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz", + "integrity": "sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA==", "dev": true, "dependencies": { - "acorn": "^8.1.0", - "acorn-walk": "^8.0.2", - "assert": "^2.0.0", - "async": "^3.0.1", - "browser-resolve": "^2.0.0", - "browserify-zlib": "^0.2.0", - "buffer": "^5.4.3", - "combine-source-map": "^0.8.0", - "console-browserify": "^1.2.0", - "constants-browserify": "^1.0.0", - "convert-source-map": "^1.7.0", - "crypto-browserify": "^3.12.0", - "diff": "^4.0.1", - "domain-browser": "^4.16.0", - "events": "^3.2.0", - "glob": "^7.1.6", - "https-browserify": "^1.0.0", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.0", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.19", - "log4js": "^6.3.0", + "glob": "^7.1.3", "minimatch": "^3.0.4", - "os-browserify": "^0.3.0", - "pad": "^3.2.0", - "path-browserify": "^1.0.0", - "process": "^0.11.10", - "punycode": "^2.1.1", - "querystring-es3": "^0.2.1", - "readable-stream": "^3.1.1", - "source-map": "^0.7.3", - "stream-browserify": "^3.0.0", - "stream-http": "^3.1.0", - "string_decoder": "^1.3.0", - "timers-browserify": "^2.0.11", - "tmp": "^0.2.1", - "tty-browserify": "^0.0.1", - "url": "^0.11.0", - "util": "^0.12.1", - "vm-browserify": "^1.1.2" + "webpack-merge": "^4.1.5" + }, + "engines": { + "node": ">= 6" }, "peerDependencies": { - "karma": "1 || 2 || 3 || 4 || 5 || 6", - "typescript": "1 || 2 || 3 || 4" + "webpack": "^5.0.0" } }, - "node_modules/karma-typescript/node_modules/async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", - "dev": true - }, - "node_modules/karma-typescript/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/karma-typescript/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/karma-typescript/node_modules/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, - "engines": { - "node": ">= 8" - } - }, - "node_modules/karma-typescript/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "node_modules/karma-webpack/node_modules/webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", "dev": true, "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" + "lodash": "^4.17.15" } }, "node_modules/karma/node_modules/source-map": { @@ -7986,12 +7411,6 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, - "node_modules/lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -8202,17 +7621,6 @@ "node": ">= 12" } }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -8269,19 +7677,6 @@ "node": ">=8.6" } }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - } - }, "node_modules/mime": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", @@ -8321,18 +7716,6 @@ "node": ">=6" } }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -9152,22 +8535,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -9269,12 +8636,6 @@ "node": ">= 0.8.0" } }, - "node_modules/os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, "node_modules/p-any": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-any/-/p-any-3.0.0.tgz", @@ -9504,24 +8865,6 @@ "node": ">=8" } }, - "node_modules/pad": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz", - "integrity": "sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==", - "dev": true, - "dependencies": { - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -9534,19 +8877,6 @@ "node": ">=6" } }, - "node_modules/parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "dependencies": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -9580,12 +8910,6 @@ "node": ">= 0.8" } }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -9636,22 +8960,6 @@ "node": "*" } }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/peer-id": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.16.0.tgz", @@ -9947,20 +9255,6 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, - "node_modules/public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -10135,25 +9429,6 @@ "node": ">=0.6" } }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -10183,16 +9458,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -10537,16 +9802,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -10667,31 +9922,12 @@ "resolved": "https://registry.npmjs.org/set-delayed-interval/-/set-delayed-interval-1.0.0.tgz", "integrity": "sha512-29fhAwuZlLcuBnW/EwxvLcg2D3ELX+VBDNhnavs3YYkab72qmrcSeQNVdzl8EcPPahGQXhBM6MKdPLCQGMDakw==" }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, "node_modules/setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -10998,18 +10234,6 @@ "readable-stream": "^3.5.0" } }, - "node_modules/stream-http": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", - "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", - "dev": true, - "dependencies": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "xtend": "^4.0.2" - } - }, "node_modules/stream-to-it": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", @@ -11505,18 +10729,6 @@ "retimer": "^3.0.0" } }, - "node_modules/timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "dependencies": { - "setimmediate": "^1.0.4" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -11767,12 +10979,6 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, - "node_modules/tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -12007,41 +11213,11 @@ "punycode": "^2.1.0" } }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - }, "node_modules/utf8-byte-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=" }, - "node_modules/util": { - "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", - "which-typed-array": "^1.1.2" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -12107,12 +11283,6 @@ "extsprintf": "^1.2.0" } }, - "node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, "node_modules/void-elements": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", @@ -12174,15 +11344,6 @@ "node": ">=10.13.0" } }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -12424,27 +11585,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "node_modules/which-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", - "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/wildcard": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", @@ -12584,15 +11724,6 @@ "resolved": "https://registry.npmjs.org/xsalsa20/-/xsalsa20-1.1.0.tgz", "integrity": "sha512-zd3ytX2cm+tcSndRU+krm0eL4TMMpZE7evs5hLRAoOy6gviqLfe3qOlkjF3i5SeAkQUCeJk0lJZrEU56kHRfWw==" }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -14652,30 +13783,6 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - } - }, - "assert": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", - "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", - "dev": true, - "requires": { - "es6-object-assign": "^1.1.0", - "is-nan": "^1.2.1", - "object-is": "^1.0.1", - "util": "^0.12.0" - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -14707,12 +13814,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, - "available-typed-arrays": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz", - "integrity": "sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA==", - "dev": true - }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -14774,12 +13875,6 @@ "readable-stream": "^3.4.0" } }, - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -14873,128 +13968,18 @@ "fill-range": "^7.0.1" } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, "browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "browser-resolve": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", - "dev": true, - "requires": { - "resolve": "^1.17.0" - } - }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "requires": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - } - } - }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, "browserslist": { "version": "4.16.7", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.7.tgz", @@ -15029,18 +14014,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, "bytes-iec": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", @@ -15157,16 +14130,6 @@ "integrity": "sha512-CLOGsVDrVamzv8sXJGaILUVI6dsuAkouJP/n6t+OxLPeeA4DDby7zn9SB6EUpa1H7oIKoE+rMmkW80zYsFfUjA==", "dev": true }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "class-is": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", @@ -15247,12 +14210,6 @@ } } }, - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, "clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -15291,26 +14248,6 @@ "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true }, - "combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", - "dev": true, - "requires": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - }, - "dependencies": { - "convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - } - } - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -15398,18 +14335,6 @@ } } }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -15459,43 +14384,6 @@ "yaml": "^1.10.0" } }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -15521,25 +14409,6 @@ "which": "^2.0.1" } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -15890,15 +14759,6 @@ "strip-bom": "^4.0.0" } }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "^1.0.2" - } - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -15924,16 +14784,6 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "devtools-protocol": { "version": "0.0.960912", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.960912.tgz", @@ -15952,17 +14802,6 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -16030,12 +14869,6 @@ "void-elements": "^2.0.0" } }, - "domain-browser": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.19.0.tgz", - "integrity": "sha512-fRA+BaAWOR/yr/t7T9E9GJztHPeFjj8U35ajyAjCDtAAnTn1Rc1f6W6VGPJrO1tkQv9zWu+JRof7z6oQtiYVFQ==", - "dev": true - }, "domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -16096,21 +14929,6 @@ "integrity": "sha512-NteznMlGtkIZCJNM2X6AVm3oMqWAdq7TjqagZhmVLPwd9mtrIq+rRxGHerjFAOFIqQJYQUMT72ncd/lVcH1cOw==", "dev": true }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "email-addresses": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", @@ -16278,12 +15096,6 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "es6-object-assign": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", - "dev": true - }, "es6-promisify": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-7.0.0.tgz", @@ -16740,16 +15552,6 @@ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -16993,12 +15795,6 @@ "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", "dev": true }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -17350,35 +16146,6 @@ "has-symbols": "^1.0.2" } }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", @@ -17413,17 +16180,6 @@ "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==" }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -17477,12 +16233,6 @@ "sshpk": "^1.7.0" } }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, "https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -17523,6 +16273,12 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "ignore-loader": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ignore-loader/-/ignore-loader-0.1.2.tgz", + "integrity": "sha1-2B8kA3bQuk8Nd4lyw60lh0EXpGM=", + "dev": true + }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -17583,15 +16339,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "dev": true, - "requires": { - "source-map": "~0.5.3" - } - }, "interface-datastore": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-6.1.0.tgz", @@ -17660,15 +16407,6 @@ "stream-to-it": "^0.2.2" } }, - "is-arguments": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", - "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", - "dev": true, - "requires": { - "call-bind": "^1.0.0" - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -17737,12 +16475,6 @@ "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "dev": true }, - "is-generator-function": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz", - "integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==", - "dev": true - }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -17765,16 +16497,6 @@ "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" }, - "is-nan": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", - "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -17858,19 +16580,6 @@ "has-symbols": "^1.0.2" } }, - "is-typed-array": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz", - "integrity": "sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" - } - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -18461,92 +17170,24 @@ "minimist": "^1.2.3" } }, - "karma-typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.3.tgz", - "integrity": "sha512-l1FHurolXEBIzRa9ExpNtjzysAhsi/vLpTazpwLHWWK86mknvVpqor6pRZ5Nid7jvOPrTBqAq0JRuLgiCdRkFw==", + "karma-webpack": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz", + "integrity": "sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA==", "dev": true, "requires": { - "acorn": "^8.1.0", - "acorn-walk": "^8.0.2", - "assert": "^2.0.0", - "async": "^3.0.1", - "browser-resolve": "^2.0.0", - "browserify-zlib": "^0.2.0", - "buffer": "^5.4.3", - "combine-source-map": "^0.8.0", - "console-browserify": "^1.2.0", - "constants-browserify": "^1.0.0", - "convert-source-map": "^1.7.0", - "crypto-browserify": "^3.12.0", - "diff": "^4.0.1", - "domain-browser": "^4.16.0", - "events": "^3.2.0", - "glob": "^7.1.6", - "https-browserify": "^1.0.0", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.0", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.19", - "log4js": "^6.3.0", + "glob": "^7.1.3", "minimatch": "^3.0.4", - "os-browserify": "^0.3.0", - "pad": "^3.2.0", - "path-browserify": "^1.0.0", - "process": "^0.11.10", - "punycode": "^2.1.1", - "querystring-es3": "^0.2.1", - "readable-stream": "^3.1.1", - "source-map": "^0.7.3", - "stream-browserify": "^3.0.0", - "stream-http": "^3.1.0", - "string_decoder": "^1.3.0", - "timers-browserify": "^2.0.11", - "tmp": "^0.2.1", - "tty-browserify": "^0.0.1", - "url": "^0.11.0", - "util": "^0.12.1", - "vm-browserify": "^1.1.2" + "webpack-merge": "^4.1.5" }, "dependencies": { - "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", - "dev": true - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", "dev": true, "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "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 - }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "requires": { - "rimraf": "^3.0.0" + "lodash": "^4.17.15" } } } @@ -18933,12 +17574,6 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, - "lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true - }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -19102,17 +17737,6 @@ "integrity": "sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ==", "dev": true }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -19154,16 +17778,6 @@ "picomatch": "^2.2.3" } }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, "mime": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", @@ -19188,18 +17802,6 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -19844,16 +18446,6 @@ "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true }, - "object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - } - }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -19928,12 +18520,6 @@ "word-wrap": "^1.2.3" } }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, "p-any": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-any/-/p-any-3.0.0.tgz", @@ -20094,21 +18680,6 @@ "release-zalgo": "^1.0.0" } }, - "pad": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz", - "integrity": "sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==", - "dev": true, - "requires": { - "wcwidth": "^1.0.1" - } - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -20118,19 +18689,6 @@ "callsites": "^3.0.0" } }, - "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -20155,12 +18713,6 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, - "path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -20196,19 +18748,6 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "peer-id": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.16.0.tgz", @@ -20434,20 +18973,6 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -20562,18 +19087,6 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -20589,16 +19102,6 @@ "safe-buffer": "^5.1.0" } }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -20868,16 +19371,6 @@ "glob": "^7.1.3" } }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -20968,28 +19461,12 @@ "resolved": "https://registry.npmjs.org/set-delayed-interval/-/set-delayed-interval-1.0.0.tgz", "integrity": "sha512-29fhAwuZlLcuBnW/EwxvLcg2D3ELX+VBDNhnavs3YYkab72qmrcSeQNVdzl8EcPPahGQXhBM6MKdPLCQGMDakw==" }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -21239,18 +19716,6 @@ "readable-stream": "^3.5.0" } }, - "stream-http": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", - "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "xtend": "^4.0.2" - } - }, "stream-to-it": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", @@ -21615,15 +20080,6 @@ "retimer": "^3.0.0" } }, - "timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -21815,12 +20271,6 @@ } } }, - "tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -21982,43 +20432,11 @@ "punycode": "^2.1.0" } }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, "utf8-byte-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=" }, - "util": { - "version": "0.12.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", - "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", - "which-typed-array": "^1.1.2" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -22072,12 +20490,6 @@ "extsprintf": "^1.2.0" } }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, "void-elements": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", @@ -22130,15 +20542,6 @@ "graceful-fs": "^4.1.2" } }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, "webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -22311,21 +20714,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "which-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", - "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" - } - }, "wildcard": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", @@ -22429,12 +20817,6 @@ "resolved": "https://registry.npmjs.org/xsalsa20/-/xsalsa20-1.1.0.tgz", "integrity": "sha512-zd3ytX2cm+tcSndRU+krm0eL4TMMpZE7evs5hLRAoOy6gviqLfe3qOlkjF3i5SeAkQUCeJk0lJZrEU56kHRfWw==" }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 79fcebc534..5a03ffe4c1 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,13 @@ "name": "js-waku", "version": "0.24.0", "description": "TypeScript implementation of the Waku v2 protocol", - "main": "build/main/index.js", - "typings": "build/main/index.d.ts", - "module": "build/esm/index.js", + "types": "./build/esm/index.d.ts", "exports": { "node": { - "module": "./build/esm/index.js", - "import": "./build/main/index.js" - }, - "default": "./build/main/index.js" + "import": "./build/esm/index.js" + } }, + "type": "module", "repository": "https://github.com/status-im/js-waku", "license": "MIT OR Apache-2.0", "keywords": [ @@ -25,15 +22,14 @@ "scripts": { "prepare": "husky install", "build": "rimraf ./build; run-p build:**", - "build:main": "tsc -p tsconfig.json", - "build:esm": "tsc --module es2015 --target es2015 --outDir build/esm", - "build:umd": "webpack --config webpack.config.js", - "build:umd:min": "webpack --config webpack.config.min.js", - "build:umd:bundle": "webpack --config webpack.config.bundle.js", - "build:umd:min:bundle": "webpack --config webpack.config.min.bundle.js", + "build:esm": "tsc", + "build:umd": "webpack --config webpack.config.cjs", + "build:umd:min": "webpack --config webpack.config.min.cjs", + "build:umd:bundle": "webpack --config webpack.config.bundle.cjs", + "build:umd:min:bundle": "webpack --config webpack.config.min.bundle.cjs", "size": "npm run build:esm && size-limit", "fix": "run-s fix:*", - "fix:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.conf.js\" \".github/**/*.yml\" --write", + "fix:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --write", "fix:lint": "eslint src --ext .ts --fix", "pretest": "run-s pretest:*", "pretest:1-init-git-submodules": "[ -f './nim-waku/build/wakunode2' ] || git submodule update --init --recursive", @@ -43,11 +39,11 @@ "nim-waku:force-build": "(cd nim-waku && rm -rf ./build/ ./vendor && make -j$(nproc --all 2>/dev/null || echo 2) update) && run-s nim-waku:build", "test": "run-s test:*", "test:lint": "eslint src --ext .ts", - "test:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.conf.js\" \".github/**/*.yml\" --list-different", + "test:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --list-different", "test:spelling": "cspell \"{README.md,.github/*.md,guides/*.md,src/**/*.ts}\"", "test:tsc": "tsc -p tsconfig.dev.json", "test:unit": "nyc --silent mocha", - "test:karma": "karma start", + "test:karma": "karma start karma.conf.cjs", "examples:test": "run-s examples:pretest; for d in examples/*/; do (cd $d && npm test;); done", "proto": "run-s proto:*", "proto:lint": "buf lint", @@ -121,6 +117,7 @@ "fast-check": "^2.14.0", "gh-pages": "^3.2.3", "husky": "^7.0.4", + "ignore-loader": "^0.1.2", "isomorphic-fetch": "^3.0.0", "jsdom": "^19.0.0", "jsdom-global": "^3.0.2", @@ -128,7 +125,7 @@ "karma-chrome-launcher": "^3.1.0", "karma-env-preprocessor": "^0.1.1", "karma-mocha": "^2.0.1", - "karma-typescript": "^5.5.3", + "karma-webpack": "^5.0.0", "lint-staged": "^12.3.4", "mocha": "^9.1.3", "npm-run-all": "^4.1.5", @@ -151,7 +148,6 @@ "webpack-cli": "^4.9.0" }, "files": [ - "build/main", "build/esm", "build/umd", "!**/*.spec.*", diff --git a/src/lib/crypto.ts b/src/lib/crypto.ts index 084dbc0318..af21699d7f 100644 --- a/src/lib/crypto.ts +++ b/src/lib/crypto.ts @@ -1,7 +1,7 @@ import nodeCrypto from "crypto"; import * as secp from "@noble/secp256k1"; -import * as sha3 from "js-sha3"; +import sha3 from "js-sha3"; import { concat } from "uint8arrays/concat"; import { Asymmetric, Symmetric } from "./waku_message/constants"; diff --git a/src/lib/discovery/dns.ts b/src/lib/discovery/dns.ts index 44374f8ddd..6ee84d5633 100644 --- a/src/lib/discovery/dns.ts +++ b/src/lib/discovery/dns.ts @@ -1,4 +1,4 @@ -import { debug } from "debug"; +import debug from "debug"; import { ENR } from "../enr"; diff --git a/src/lib/discovery/enrtree.ts b/src/lib/discovery/enrtree.ts index ca18a8dc33..670934e7fd 100644 --- a/src/lib/discovery/enrtree.ts +++ b/src/lib/discovery/enrtree.ts @@ -1,4 +1,4 @@ -import * as base32 from "hi-base32"; +import base32 from "hi-base32"; import { fromString } from "uint8arrays/from-string"; import { keccak256, verifySignature } from "../crypto"; diff --git a/src/lib/discovery/fetch_nodes.ts b/src/lib/discovery/fetch_nodes.ts index c836d965d1..60d2cd3a31 100644 --- a/src/lib/discovery/fetch_nodes.ts +++ b/src/lib/discovery/fetch_nodes.ts @@ -1,4 +1,4 @@ -import { debug } from "debug"; +import debug from "debug"; import { ENR, Waku2 } from "../enr"; diff --git a/src/lib/waku_light_push/push_rpc.ts b/src/lib/waku_light_push/push_rpc.ts index e2d0329fae..12b8f7b87d 100644 --- a/src/lib/waku_light_push/push_rpc.ts +++ b/src/lib/waku_light_push/push_rpc.ts @@ -1,9 +1,11 @@ -import { Reader } from "protobufjs/minimal"; +import protobufjs from "protobufjs/minimal"; import { v4 as uuid } from "uuid"; import * as proto from "../../proto/waku/v2/light_push"; import { WakuMessage } from "../waku_message"; +const { Reader } = protobufjs; + export class PushRPC { public constructor(public proto: proto.PushRPC) {} diff --git a/src/lib/waku_message/index.ts b/src/lib/waku_message/index.ts index 2bf49bb3e9..47b1fd77c7 100644 --- a/src/lib/waku_message/index.ts +++ b/src/lib/waku_message/index.ts @@ -1,12 +1,13 @@ import debug from "debug"; import Long from "long"; -import { Reader } from "protobufjs/minimal"; +import protobufjs from "protobufjs/minimal"; import * as proto from "../../proto/waku/v2/message"; import { bytesToUtf8, utf8ToBytes } from "../utils"; import * as version_1 from "./version_1"; +const { Reader } = protobufjs; const DefaultVersion = 0; const dbg = debug("waku:message"); diff --git a/src/lib/waku_store/history_rpc.ts b/src/lib/waku_store/history_rpc.ts index 25b8bbab60..35fd60fe65 100644 --- a/src/lib/waku_store/history_rpc.ts +++ b/src/lib/waku_store/history_rpc.ts @@ -1,5 +1,5 @@ import Long from "long"; -import { Reader } from "protobufjs/minimal"; +import protobufjs from "protobufjs/minimal"; import { v4 as uuid } from "uuid"; import * as protoV2Beta3 from "../../proto/waku/v2/store/v2beta3/store"; @@ -7,6 +7,8 @@ import * as protoV2Beta4 from "../../proto/waku/v2/store/v2beta4/store"; import { StoreCodecs } from "./constants"; +const { Reader } = protobufjs; + export enum PageDirection { BACKWARD = "backward", FORWARD = "forward", diff --git a/tsconfig.json b/tsconfig.json index 5206e48d13..da0859c7e6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,11 @@ { "compilerOptions": { "incremental": true, - "target": "es2020", - "outDir": "build/main", + "target": "es2015", + "outDir": "build/esm", "rootDir": "src", "moduleResolution": "node", - "module": "commonjs", + "module": "es2020", "declaration": true, "sourceMap": true, "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, diff --git a/webpack.config.bundle.cjs b/webpack.config.bundle.cjs new file mode 100644 index 0000000000..56f701e1e3 --- /dev/null +++ b/webpack.config.bundle.cjs @@ -0,0 +1,40 @@ +const webpack = require("webpack"); +const path = require("path"); + +module.exports = { + mode: "development", + entry: { + "js-waku": "./src/index.ts", + }, + devtool: "inline-source-map", + module: { + rules: [ + { + test: /\.ts$/, + use: "ts-loader", + exclude: /node_modules/, + }, + ], + }, + plugins: [ + new webpack.ProvidePlugin({ + process: "process/browser.js", + Buffer: ["buffer", "Buffer"], + }), + ], + resolve: { + extensions: [".ts", ".js"], + fallback: { + buffer: require.resolve("buffer/"), + crypto: false, + stream: require.resolve("stream-browserify"), + }, + }, + output: { + filename: "[name].bundle.js", + path: path.resolve(__dirname, "build/umd"), + library: "jswaku", + libraryTarget: "umd", + globalObject: "this", + }, +}; diff --git a/webpack.config.bundle.js b/webpack.config.bundle.js deleted file mode 100644 index 78ad5c0cb0..0000000000 --- a/webpack.config.bundle.js +++ /dev/null @@ -1,38 +0,0 @@ -const webpack = require('webpack'); -const path = require('path'); - -module.exports = { - mode: 'development', - entry: { - "js-waku": './src/index.ts' - }, - devtool: 'inline-source-map', - module: { - rules: [{ - test: /\.ts$/, - use: 'ts-loader', - exclude: /node_modules/ - }] - }, - plugins: [ - new webpack.ProvidePlugin({ - process: 'process/browser.js', - Buffer: ['buffer', 'Buffer'], - }) - ], - resolve: { - extensions: ['.ts', '.js'], - fallback: { - buffer: require.resolve('buffer/'), - crypto: false, - stream: require.resolve('stream-browserify'), - }, - }, - output: { - filename: '[name].bundle.js', - path: path.resolve(__dirname, 'build/umd'), - library: 'jswaku', - libraryTarget: 'umd', - globalObject: 'this', - } -}; diff --git a/webpack.config.cjs b/webpack.config.cjs new file mode 100644 index 0000000000..61f4bf8614 --- /dev/null +++ b/webpack.config.cjs @@ -0,0 +1,50 @@ +const webpack = require("webpack"); +const path = require("path"); + +module.exports = { + mode: "development", + entry: { + "js-waku": "./src/index.ts", + }, + devtool: "inline-source-map", + module: { + rules: [ + { + test: /\.ts$/, + use: "ts-loader", + exclude: /(node_modules)|(node\.spec\.ts)/, + }, + { + test: /node\.spec\.ts$/, + use: "ignore-loader", + }, + ], + }, + plugins: [ + new webpack.ProvidePlugin({ + process: "process/browser.js", + Buffer: ["buffer", "Buffer"], + }), + ], + resolve: { + extensions: [".ts", ".js"], + fallback: { + buffer: require.resolve("buffer/"), + crypto: false, + stream: require.resolve("stream-browserify"), + }, + }, + output: { + filename: "[name].js", + path: path.resolve(__dirname, "build/umd"), + library: "jswaku", + libraryTarget: "umd", + globalObject: "this", + }, + optimization: { + splitChunks: { + name: "vendors", + chunks: "all", + }, + }, +}; diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index f45e8a483f..0000000000 --- a/webpack.config.js +++ /dev/null @@ -1,44 +0,0 @@ -const webpack = require('webpack'); -const path = require('path'); - -module.exports = { - mode: 'development', - entry: { - "js-waku": './src/index.ts' - }, - devtool: 'inline-source-map', - module: { - rules: [{ - test: /\.ts$/, - use: 'ts-loader', - exclude: /node_modules/ - }] - }, - plugins: [ - new webpack.ProvidePlugin({ - process: 'process/browser.js', - Buffer: ['buffer', 'Buffer'], - }) - ], - resolve: { - extensions: ['.ts', '.js'], - fallback: { - buffer: require.resolve('buffer/'), - crypto: false, - stream: require.resolve('stream-browserify'), - }, - }, - output: { - filename: '[name].js', - path: path.resolve(__dirname, 'build/umd'), - library: 'jswaku', - libraryTarget: 'umd', - globalObject: 'this', - }, - optimization: { - splitChunks: { - name: 'vendors', - chunks: 'all', - } - } -}; diff --git a/webpack.config.min.bundle.cjs b/webpack.config.min.bundle.cjs new file mode 100644 index 0000000000..ec3e1d1c1a --- /dev/null +++ b/webpack.config.min.bundle.cjs @@ -0,0 +1,40 @@ +const webpack = require("webpack"); +const path = require("path"); + +module.exports = { + mode: "production", + entry: { + "js-waku": "./src/index.ts", + }, + devtool: "inline-source-map", + module: { + rules: [ + { + test: /\.ts$/, + use: "ts-loader", + exclude: /node_modules/, + }, + ], + }, + plugins: [ + new webpack.ProvidePlugin({ + process: "process/browser.js", + Buffer: ["buffer", "Buffer"], + }), + ], + resolve: { + extensions: [".ts", ".js"], + fallback: { + buffer: require.resolve("buffer/"), + crypto: false, + stream: require.resolve("stream-browserify"), + }, + }, + output: { + filename: "[name].min.bundle.js", + path: path.resolve(__dirname, "build/umd"), + library: "jswaku", + libraryTarget: "umd", + globalObject: "this", + }, +}; diff --git a/webpack.config.min.bundle.js b/webpack.config.min.bundle.js deleted file mode 100644 index a2431c172c..0000000000 --- a/webpack.config.min.bundle.js +++ /dev/null @@ -1,38 +0,0 @@ -const webpack = require('webpack'); -const path = require('path'); - -module.exports = { - mode: 'production', - entry: { - "js-waku": './src/index.ts' - }, - devtool: 'inline-source-map', - module: { - rules: [{ - test: /\.ts$/, - use: 'ts-loader', - exclude: /node_modules/ - }] - }, - plugins: [ - new webpack.ProvidePlugin({ - process: 'process/browser.js', - Buffer: ['buffer', 'Buffer'], - }) - ], - resolve: { - extensions: ['.ts', '.js'], - fallback: { - buffer: require.resolve('buffer/'), - crypto: false, - stream: require.resolve('stream-browserify'), - }, - }, - output: { - filename: '[name].min.bundle.js', - path: path.resolve(__dirname, 'build/umd'), - library: 'jswaku', - libraryTarget: 'umd', - globalObject: 'this', - } -}; diff --git a/webpack.config.min.cjs b/webpack.config.min.cjs new file mode 100644 index 0000000000..fe707bbbec --- /dev/null +++ b/webpack.config.min.cjs @@ -0,0 +1,46 @@ +const webpack = require("webpack"); +const path = require("path"); + +module.exports = { + mode: "production", + entry: { + "js-waku": "./src/index.ts", + }, + devtool: "inline-source-map", + module: { + rules: [ + { + test: /\.ts$/, + use: "ts-loader", + exclude: /node_modules/, + }, + ], + }, + plugins: [ + new webpack.ProvidePlugin({ + process: "process/browser.js", + Buffer: ["buffer", "Buffer"], + }), + ], + resolve: { + extensions: [".ts", ".js"], + fallback: { + buffer: require.resolve("buffer/"), + crypto: false, + stream: require.resolve("stream-browserify"), + }, + }, + output: { + filename: "[name].min.js", + path: path.resolve(__dirname, "build/umd"), + library: "jswaku", + libraryTarget: "umd", + globalObject: "this", + }, + optimization: { + splitChunks: { + name: "vendors", + chunks: "all", + }, + }, +}; diff --git a/webpack.config.min.js b/webpack.config.min.js deleted file mode 100644 index b435bdf0c4..0000000000 --- a/webpack.config.min.js +++ /dev/null @@ -1,44 +0,0 @@ -const webpack = require('webpack'); -const path = require('path'); - -module.exports = { - mode: 'production', - entry: { - "js-waku": './src/index.ts' - }, - devtool: 'inline-source-map', - module: { - rules: [{ - test: /\.ts$/, - use: 'ts-loader', - exclude: /node_modules/ - }] - }, - plugins: [ - new webpack.ProvidePlugin({ - process: 'process/browser.js', - Buffer: ['buffer', 'Buffer'], - }) - ], - resolve: { - extensions: ['.ts', '.js'], - fallback: { - buffer: require.resolve('buffer/'), - crypto: false, - stream: require.resolve('stream-browserify'), - }, - }, - output: { - filename: '[name].min.js', - path: path.resolve(__dirname, 'build/umd'), - library: 'jswaku', - libraryTarget: 'umd', - globalObject: 'this', - }, - optimization: { - splitChunks: { - name: 'vendors', - chunks: 'all', - } - } -}; From 4352cb923d70ddb7ff31463994a3e1d0e74eb3ef Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 23 May 2022 14:40:37 +1000 Subject: [PATCH 02/26] Replace karma-env-preproc with webpack --- karma.conf.cjs | 10 ++++++++-- package-lock.json | 13 ------------- package.json | 1 - src/lib/discovery/dns.spec.ts | 9 +-------- src/lib/discovery/index.spec.ts | 9 +-------- src/lib/waku.spec.ts | 9 +-------- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/karma.conf.cjs b/karma.conf.cjs index 16ff72e5a1..2852c6faca 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -1,12 +1,13 @@ process.env.CHROME_BIN = require("puppeteer").executablePath(); const webpackConfig = require("./webpack.config.cjs"); +const webpack = require("webpack"); module.exports = function (config) { config.set({ frameworks: ["webpack", "mocha"], files: ["src/lib/**/!(node).spec.ts"], preprocessors: { - "src/lib/**/!(node).spec.ts": ["env", "webpack"], + "src/lib/**/!(node).spec.ts": ["webpack"], }, envPreprocessor: ["CI"], reporters: ["progress"], @@ -20,7 +21,12 @@ module.exports = function (config) { webpack: { mode: "production", module: webpackConfig.module, - plugins: webpackConfig.plugins, + plugins: [ + new webpack.DefinePlugin({ + "process.env.CI": process.env.CI || false, + }), + ...webpackConfig.plugins, + ], resolve: webpackConfig.resolve, stats: { warnings: false }, }, diff --git a/package-lock.json b/package-lock.json index a18bf3706d..a141a03f2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,6 @@ "jsdom-global": "^3.0.2", "karma": "^6.3.12", "karma-chrome-launcher": "^3.1.0", - "karma-env-preprocessor": "^0.1.1", "karma-mocha": "^2.0.1", "karma-webpack": "^5.0.0", "lint-staged": "^12.3.4", @@ -6883,12 +6882,6 @@ "which": "bin/which" } }, - "node_modules/karma-env-preprocessor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/karma-env-preprocessor/-/karma-env-preprocessor-0.1.1.tgz", - "integrity": "sha1-u+jIfVnADtt2BwvTwxtLOdXcfhU=", - "dev": true - }, "node_modules/karma-mocha": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", @@ -17155,12 +17148,6 @@ } } }, - "karma-env-preprocessor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/karma-env-preprocessor/-/karma-env-preprocessor-0.1.1.tgz", - "integrity": "sha1-u+jIfVnADtt2BwvTwxtLOdXcfhU=", - "dev": true - }, "karma-mocha": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", diff --git a/package.json b/package.json index 5a03ffe4c1..2024e7446f 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,6 @@ "jsdom-global": "^3.0.2", "karma": "^6.3.12", "karma-chrome-launcher": "^3.1.0", - "karma-env-preprocessor": "^0.1.1", "karma-mocha": "^2.0.1", "karma-webpack": "^5.0.0", "lint-staged": "^12.3.4", diff --git a/src/lib/discovery/dns.spec.ts b/src/lib/discovery/dns.spec.ts index a6d2de5aee..2db676f514 100644 --- a/src/lib/discovery/dns.spec.ts +++ b/src/lib/discovery/dns.spec.ts @@ -3,13 +3,6 @@ import { expect } from "chai"; import { DnsClient, DnsNodeDiscovery } from "./dns"; import testData from "./testdata.json"; -declare global { - interface Window { - __env__?: any; - } -} -declare let window: Window | undefined; - const mockData = testData.dns; const host = "nodes.example.org"; @@ -273,7 +266,7 @@ describe("DNS Node Discovery [live data]", function () { const maxQuantity = 3; before(function () { - if (process.env.CI || window?.__env__?.CI) { + if (process.env.CI) { this.skip(); } }); diff --git a/src/lib/discovery/index.spec.ts b/src/lib/discovery/index.spec.ts index a0ee745f2b..f68126a033 100644 --- a/src/lib/discovery/index.spec.ts +++ b/src/lib/discovery/index.spec.ts @@ -3,13 +3,6 @@ import { expect } from "chai"; import { fleets } from "./predefined"; import { getPseudoRandomSubset } from "./random_subset"; -declare global { - interface Window { - __env__?: any; - } -} -declare let window: Window | undefined; - describe("Discovery", () => { it("returns all values when wanted number matches available values", function () { const values = ["a", "b", "c"]; @@ -44,7 +37,7 @@ describe("Discovery", () => { describe("Discovery [live data]", function () { before(function () { - if (process.env.CI || window?.__env__?.CI) { + if (process.env.CI) { this.skip(); } }); diff --git a/src/lib/waku.spec.ts b/src/lib/waku.spec.ts index 77e9c21915..e72bb9db66 100644 --- a/src/lib/waku.spec.ts +++ b/src/lib/waku.spec.ts @@ -3,13 +3,6 @@ import PeerId from "peer-id"; import { Waku } from "./waku"; -declare global { - interface Window { - __env__?: any; - } -} -declare let window: Window | undefined; - describe("Waku Dial", function () { describe("Bootstrap [live data]", function () { let waku: Waku; @@ -19,7 +12,7 @@ describe("Waku Dial", function () { }); before(function () { - if (process.env.CI || window?.__env__?.CI) { + if (process.env.CI) { this.skip(); } }); From 35a4cba37a062da8aea7b490c804755dbb847aa2 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 23 May 2022 15:12:37 +1000 Subject: [PATCH 03/26] Include src files in package To remove source map warning --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 2024e7446f..8247b72b18 100644 --- a/package.json +++ b/package.json @@ -149,6 +149,8 @@ "files": [ "build/esm", "build/umd", + "src/lib/**/*.ts", + "src/proto/**/*.ts", "!**/*.spec.*", "!**/*.json", "CHANGELOG.md", From 75d2cf1113caad69779a8ce5f757d4d8575d5a89 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 23 May 2022 15:18:33 +1000 Subject: [PATCH 04/26] Fix size-limit --- .github/workflows/size-limit.yml | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 63d14ff4b6..8f1704b659 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -11,4 +11,5 @@ jobs: - uses: actions/checkout@v1 - uses: andresz1/size-limit-action@v1 with: + skip_step: build # Done in the package.json script github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 8247b72b18..1d49f6e474 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ { "path": "build/esm/index.js", "import": "{ Waku }", - "config": "./webpack.config.js" + "config": "./webpack.config.cjs" } ], "lint-staged": { From 1bfc72fa2a29564c9f768273c706bd79941e3c3c Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 27 May 2022 14:51:12 +1000 Subject: [PATCH 05/26] Fix include/exclude folders in tsconfig --- tsconfig.dev.json | 2 +- tsconfig.json | 4 ++-- tsconfig.umd.json | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tsconfig.dev.json b/tsconfig.dev.json index 5cdf5d2ea6..44c5c662c1 100644 --- a/tsconfig.dev.json +++ b/tsconfig.dev.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "exclude": ["node_modules/**"] + "exclude": [] } diff --git a/tsconfig.json b/tsconfig.json index da0859c7e6..e87fb8f9e3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -45,8 +45,8 @@ "types": ["node", "mocha"], "typeRoots": ["node_modules/@types", "src/types"] }, - "include": ["src/**/*.ts"], - "exclude": ["node_modules/**", "src/**/*.spec.ts", "src/test_utils"], + "include": ["src"], + "exclude": ["src/**/*.spec.ts", "src/test_utils"], "compileOnSave": false, "ts-node": { "files": true diff --git a/tsconfig.umd.json b/tsconfig.umd.json index 745ea3a123..eb4a5cce5b 100644 --- a/tsconfig.umd.json +++ b/tsconfig.umd.json @@ -5,6 +5,5 @@ "target": "es6", "removeComments": true, "outFile": "build/min.js" - }, - "exclude": ["node_modules/**", "src/**/*.spec.ts", "src/test_utils"] + } } From 82aba32f9e3fb1973e6d105600425ec2b8d4c5a0 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 27 May 2022 16:48:44 +1000 Subject: [PATCH 06/26] Migrate from ts-proto to protons The latter does not bring Buffer/Long and is ESM compatible. --- package-lock.json | 895 +++++++++++++++--- package.json | 9 +- src/lib/waku_filter/filter_rpc.ts | 7 +- src/lib/waku_filter/index.ts | 2 +- src/lib/waku_light_push/index.ts | 2 +- src/lib/waku_light_push/push_rpc.ts | 9 +- src/lib/waku_message/index.ts | 15 +- src/lib/waku_store/history_rpc.ts | 38 +- src/lib/waku_store/index.ts | 6 +- {proto/waku/v2 => src/proto}/filter.proto | 10 +- src/proto/filter.ts | 135 +++ {proto/waku/v2 => src/proto}/light_push.proto | 8 +- src/proto/light_push.ts | 111 +++ {proto/waku/v2 => src/proto}/message.proto | 2 - src/proto/message.ts | 42 + .../proto/store_v2beta3.proto | 8 +- src/proto/store_v2beta3.ts | 224 +++++ .../proto/store_v2beta4.proto | 8 +- src/proto/store_v2beta4.ts | 226 +++++ src/proto/waku/v2/filter.ts | 358 ------- src/proto/waku/v2/light_push.ts | 281 ------ src/proto/waku/v2/message.ts | 200 ---- src/proto/waku/v2/store/v2beta3/store.ts | 704 -------------- src/proto/waku/v2/store/v2beta4/store.ts | 741 --------------- src/test_utils/nwaku.ts | 4 +- 25 files changed, 1564 insertions(+), 2481 deletions(-) rename {proto/waku/v2 => src/proto}/filter.proto (74%) create mode 100644 src/proto/filter.ts rename {proto/waku/v2 => src/proto}/light_push.proto (66%) create mode 100644 src/proto/light_push.ts rename {proto/waku/v2 => src/proto}/message.proto (92%) create mode 100644 src/proto/message.ts rename proto/waku/v2/store/v2beta3/store.proto => src/proto/store_v2beta3.proto (86%) create mode 100644 src/proto/store_v2beta3.ts rename proto/waku/v2/store/v2beta4/store.proto => src/proto/store_v2beta4.proto (87%) create mode 100644 src/proto/store_v2beta4.ts delete mode 100644 src/proto/waku/v2/filter.ts delete mode 100644 src/proto/waku/v2/light_push.ts delete mode 100644 src/proto/waku/v2/message.ts delete mode 100644 src/proto/waku/v2/store/v2beta3/store.ts delete mode 100644 src/proto/waku/v2/store/v2beta4/store.ts diff --git a/package-lock.json b/package-lock.json index a141a03f2e..8346300fe1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,11 +26,10 @@ "libp2p-interfaces": "^4.0.6", "libp2p-mplex": "^0.10.4", "libp2p-websockets": "^0.16.1", - "long": "^4.0.0", "multiaddr": "^10.0.1", "multiformats": "^9.6.5", "peer-id": "^0.16.0", - "protobufjs": "^6.8.8", + "protons-runtime": "^1.0.4", "uint8arrays": "^3.0.0", "uuid": "^8.3.2", "varint": "^6.0.0" @@ -77,13 +76,13 @@ "portfinder": "^1.0.28", "prettier": "^2.1.1", "process": "^0.11.10", + "protons": "^3.0.4", "puppeteer": "^13.0.1", "size-limit": "^7.0.8", "stream-browserify": "^3.0.0", "tail": "^2.2.0", "ts-loader": "^9.2.6", "ts-node": "^10.4.0", - "ts-proto": "^1.82.5", "typedoc": "^0.22.10", "typedoc-plugin-no-inherit": "^1.3.1", "typescript": "^4.5.5", @@ -1523,6 +1522,12 @@ "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, "node_modules/@types/mocha": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", @@ -1539,10 +1544,10 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.6.tgz", "integrity": "sha512-+XBAjfZmmivILUzO0HwBJoYkAyyySSLg5KCGBDFLomJo0sV6szvVLAf4ANZZ0pfWzgEds5KmGLG9D5hfEqOhaA==" }, - "node_modules/@types/object-hash": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", - "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==", + "node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, "node_modules/@types/parse-json": { @@ -1551,12 +1556,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "node_modules/@types/prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==", - "dev": true - }, "node_modules/@types/retry": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", @@ -2464,6 +2463,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/asn1": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", @@ -2839,6 +2847,48 @@ "node": ">=6" } }, + "node_modules/camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, + "dependencies": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001299", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001299.tgz", @@ -3618,12 +3668,6 @@ "node": ">=12" } }, - "node_modules/dataloader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", - "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==", - "dev": true - }, "node_modules/datastore-core": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-7.0.0.tgz", @@ -3680,6 +3724,28 @@ "node": ">=0.10.0" } }, + "node_modules/decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/decimal.js": { "version": "10.3.1", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", @@ -5537,6 +5603,15 @@ "node": ">=6" } }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -7602,6 +7677,18 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/marked": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz", @@ -7632,6 +7719,92 @@ "node": ">= 0.10.0" } }, + "node_modules/meow": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.2.tgz", + "integrity": "sha512-zbuAlN+V/sXlbGchNS9WTWjUzeamwMt/BApKCJi7B0QyZstZaMx0n4Unll/fg0njGtMdC9UP5SAscvOCLYdM+Q==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/merge-options": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", @@ -7709,6 +7882,15 @@ "node": ">=6" } }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -7726,6 +7908,29 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/minimist-options/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -8510,15 +8715,6 @@ "node": ">=0.10.0" } }, - "node_modules/object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", - "dev": true, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", @@ -9237,6 +9433,36 @@ "pbts": "bin/pbts" } }, + "node_modules/protons": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/protons/-/protons-3.0.4.tgz", + "integrity": "sha512-R0X/4pCfpXo3X2CVMmhDLHnHRqVg202N32p8qESKc1Vh8cD7Lqj6DBB/Z6yk6lgrH2UEneCHmHYzqonRl+l+pg==", + "dev": true, + "dependencies": { + "meow": "^10.1.2", + "protobufjs": "^6.11.2" + }, + "bin": { + "protons": "dist/bin/protons.js" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/protons-runtime": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-1.0.4.tgz", + "integrity": "sha512-DSKWjAgwaXhtYO5Jo/MrU8n/75I/P2IhxU0Fk/lSrXx6Gxl5DH+I6cHcbGAYFmAlOBmU4QRa0mvVme8VXlDeUg==", + "dependencies": { + "uint8arraylist": "^1.4.0", + "uint8arrays": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -9442,6 +9668,18 @@ } ] }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -9553,6 +9791,135 @@ "node": ">=4" } }, + "node_modules/read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/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, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/read-pkg-up/node_modules/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, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/read-pkg-up/node_modules/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, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/read-pkg/node_modules/path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", @@ -9598,6 +9965,34 @@ "ms": "^2.1.1" } }, + "node_modules/redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dev": true, + "dependencies": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/redent/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -10421,6 +10816,21 @@ "node": ">=6" } }, + "node_modules/strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -10776,6 +11186,18 @@ "node": ">=12" } }, + "node_modules/trim-newlines": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.0.2.tgz", + "integrity": "sha512-GJtWyq9InR/2HRiLZgpIKv+ufIKrVrvjQWEj7PxAXNc5dwbNJkqhAUoAGgzRmULAnoOM5EIpveYd3J2VeSAIew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/trim-repeated": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", @@ -10874,44 +11296,6 @@ "node": ">=0.3.1" } }, - "node_modules/ts-poet": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.5.0.tgz", - "integrity": "sha512-Vs2Zsiz3zf5qdFulFTIEpaLdgWeHXKh+4pv+ycVqEh+ZuUOVGrN0i9lbxVx7DB1FBogExytz3OuaBMJfWffpSQ==", - "dev": true, - "dependencies": { - "@types/prettier": "^1.19.0", - "lodash": "^4.17.15", - "prettier": "^2.0.2" - } - }, - "node_modules/ts-proto": { - "version": "1.106.2", - "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.106.2.tgz", - "integrity": "sha512-z/vjCqxvtxzX1tiV4vsxp9msr1CWlE2qB1Qc/KyyoA2DA6nA2D8IIELrWeurx6+bM5S1GPqMgzYx2ZkAKq6ulw==", - "dev": true, - "dependencies": { - "@types/object-hash": "^1.3.0", - "dataloader": "^1.4.0", - "object-hash": "^1.3.1", - "protobufjs": "^6.8.8", - "ts-poet": "^4.5.0", - "ts-proto-descriptors": "1.6.0" - }, - "bin": { - "protoc-gen-ts_proto": "protoc-gen-ts_proto" - } - }, - "node_modules/ts-proto-descriptors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.6.0.tgz", - "integrity": "sha512-Vrhue2Ti99us/o76mGy28nF3W/Uanl1/8detyJw2yyRwiBC5yxy+hEZqQ/ZX2PbZ1vyCpJ51A9L4PnCCnkBMTQ==", - "dev": true, - "dependencies": { - "long": "^4.0.0", - "protobufjs": "^6.8.8" - } - }, "node_modules/tsconfig-paths": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", @@ -11106,6 +11490,18 @@ "node": "*" } }, + "node_modules/uint8arraylist": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-1.5.1.tgz", + "integrity": "sha512-UpPGcVlTVc7Brtwt4W2MfTqvJQsr8owHMKBnICsueSImiarVAHf8NGMjhMklFtgbCZN1/9S9oW5k1JwlalGHoA==", + "dependencies": { + "uint8arrays": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/uint8arrays": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", @@ -13071,6 +13467,12 @@ "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" }, + "@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, "@types/mocha": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", @@ -13087,10 +13489,10 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.6.tgz", "integrity": "sha512-+XBAjfZmmivILUzO0HwBJoYkAyyySSLg5KCGBDFLomJo0sV6szvVLAf4ANZZ0pfWzgEds5KmGLG9D5hfEqOhaA==" }, - "@types/object-hash": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", - "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==", + "@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, "@types/parse-json": { @@ -13099,12 +13501,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "@types/prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==", - "dev": true - }, "@types/retry": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", @@ -13768,6 +14164,12 @@ "es-abstract": "^1.19.0" } }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true + }, "asn1": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", @@ -14047,6 +14449,32 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, + "camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, + "requires": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + } + } + }, "caniuse-lite": { "version": "1.0.30001299", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001299.tgz", @@ -14653,12 +15081,6 @@ "whatwg-url": "^10.0.0" } }, - "dataloader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", - "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==", - "dev": true - }, "datastore-core": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-7.0.0.tgz", @@ -14697,6 +15119,24 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, "decimal.js": { "version": "10.3.1", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", @@ -16097,6 +16537,12 @@ "har-schema": "^2.0.0" } }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -17718,6 +18164,12 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true + }, "marked": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz", @@ -17736,6 +18188,67 @@ "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", "dev": true }, + "meow": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.2.tgz", + "integrity": "sha512-zbuAlN+V/sXlbGchNS9WTWjUzeamwMt/BApKCJi7B0QyZstZaMx0n4Unll/fg0njGtMdC9UP5SAscvOCLYdM+Q==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + }, + "dependencies": { + "decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true + }, + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + } + }, + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } + } + }, "merge-options": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", @@ -17789,6 +18302,12 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -17803,6 +18322,25 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "dependencies": { + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + } + } + }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -18421,12 +18959,6 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, - "object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", - "dev": true - }, "object-inspect": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", @@ -18949,6 +19481,25 @@ "long": "^4.0.0" } }, + "protons": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/protons/-/protons-3.0.4.tgz", + "integrity": "sha512-R0X/4pCfpXo3X2CVMmhDLHnHRqVg202N32p8qESKc1Vh8cD7Lqj6DBB/Z6yk6lgrH2UEneCHmHYzqonRl+l+pg==", + "dev": true, + "requires": { + "meow": "^10.1.2", + "protobufjs": "^6.11.2" + } + }, + "protons-runtime": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-1.0.4.tgz", + "integrity": "sha512-DSKWjAgwaXhtYO5Jo/MrU8n/75I/P2IhxU0Fk/lSrXx6Gxl5DH+I6cHcbGAYFmAlOBmU4QRa0mvVme8VXlDeUg==", + "requires": { + "uint8arraylist": "^1.4.0", + "uint8arrays": "^3.0.0" + } + }, "proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -19080,6 +19631,12 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -19183,6 +19740,92 @@ } } }, + "read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dev": true, + "requires": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, + "dependencies": { + "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", + "path-exists": "^4.0.0" + } + }, + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "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" + } + }, + "normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + } + }, + "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" + } + }, + "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 + }, + "read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + } + }, + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + } + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -19210,6 +19853,24 @@ "ms": "^2.1.1" } }, + "redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dev": true, + "requires": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + }, + "dependencies": { + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true + } + } + }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -19841,6 +20502,15 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" }, + "strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "requires": { + "min-indent": "^1.0.1" + } + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -20106,6 +20776,12 @@ "punycode": "^2.1.1" } }, + "trim-newlines": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.0.2.tgz", + "integrity": "sha512-GJtWyq9InR/2HRiLZgpIKv+ufIKrVrvjQWEj7PxAXNc5dwbNJkqhAUoAGgzRmULAnoOM5EIpveYd3J2VeSAIew==", + "dev": true + }, "trim-repeated": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", @@ -20171,41 +20847,6 @@ } } }, - "ts-poet": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.5.0.tgz", - "integrity": "sha512-Vs2Zsiz3zf5qdFulFTIEpaLdgWeHXKh+4pv+ycVqEh+ZuUOVGrN0i9lbxVx7DB1FBogExytz3OuaBMJfWffpSQ==", - "dev": true, - "requires": { - "@types/prettier": "^1.19.0", - "lodash": "^4.17.15", - "prettier": "^2.0.2" - } - }, - "ts-proto": { - "version": "1.106.2", - "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.106.2.tgz", - "integrity": "sha512-z/vjCqxvtxzX1tiV4vsxp9msr1CWlE2qB1Qc/KyyoA2DA6nA2D8IIELrWeurx6+bM5S1GPqMgzYx2ZkAKq6ulw==", - "dev": true, - "requires": { - "@types/object-hash": "^1.3.0", - "dataloader": "^1.4.0", - "object-hash": "^1.3.1", - "protobufjs": "^6.8.8", - "ts-poet": "^4.5.0", - "ts-proto-descriptors": "1.6.0" - } - }, - "ts-proto-descriptors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.6.0.tgz", - "integrity": "sha512-Vrhue2Ti99us/o76mGy28nF3W/Uanl1/8detyJw2yyRwiBC5yxy+hEZqQ/ZX2PbZ1vyCpJ51A9L4PnCCnkBMTQ==", - "dev": true, - "requires": { - "long": "^4.0.0", - "protobufjs": "^6.8.8" - } - }, "tsconfig-paths": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", @@ -20343,6 +20984,14 @@ "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", "dev": true }, + "uint8arraylist": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-1.5.1.tgz", + "integrity": "sha512-UpPGcVlTVc7Brtwt4W2MfTqvJQsr8owHMKBnICsueSImiarVAHf8NGMjhMklFtgbCZN1/9S9oW5k1JwlalGHoA==", + "requires": { + "uint8arrays": "^3.0.0" + } + }, "uint8arrays": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz", diff --git a/package.json b/package.json index 1d49f6e474..912b27d95f 100644 --- a/package.json +++ b/package.json @@ -45,9 +45,7 @@ "test:unit": "nyc --silent mocha", "test:karma": "karma start karma.conf.cjs", "examples:test": "run-s examples:pretest; for d in examples/*/; do (cd $d && npm test;); done", - "proto": "run-s proto:*", - "proto:lint": "buf lint", - "proto:build": "rimraf ./src/proto && buf generate", + "proto": "rimraf src/proto/*.ts; protons src/proto/*.proto", "watch:build": "tsc -p tsconfig.json -w", "watch:test": "nyc --silent mocha --watch", "doc": "run-s doc:*", @@ -82,11 +80,10 @@ "libp2p-interfaces": "^4.0.6", "libp2p-mplex": "^0.10.4", "libp2p-websockets": "^0.16.1", - "long": "^4.0.0", "multiaddr": "^10.0.1", "multiformats": "^9.6.5", "peer-id": "^0.16.0", - "protobufjs": "^6.8.8", + "protons-runtime": "^1.0.4", "uint8arrays": "^3.0.0", "uuid": "^8.3.2", "varint": "^6.0.0" @@ -133,13 +130,13 @@ "portfinder": "^1.0.28", "prettier": "^2.1.1", "process": "^0.11.10", + "protons": "^3.0.4", "puppeteer": "^13.0.1", "size-limit": "^7.0.8", "stream-browserify": "^3.0.0", "tail": "^2.2.0", "ts-loader": "^9.2.6", "ts-node": "^10.4.0", - "ts-proto": "^1.82.5", "typedoc": "^0.22.10", "typedoc-plugin-no-inherit": "^1.3.1", "typescript": "^4.5.5", diff --git a/src/lib/waku_filter/filter_rpc.ts b/src/lib/waku_filter/filter_rpc.ts index 6ce3b7bc23..db38b2cb7e 100644 --- a/src/lib/waku_filter/filter_rpc.ts +++ b/src/lib/waku_filter/filter_rpc.ts @@ -1,7 +1,6 @@ -import { Reader } from "protobufjs/minimal"; import { v4 as uuid } from "uuid"; -import * as proto from "../../proto/waku/v2/filter"; +import * as proto from "../../proto/filter"; export type ContentFilter = { contentTopic: string; @@ -36,7 +35,7 @@ export class FilterRPC { * @returns FilterRPC */ static decode(bytes: Uint8Array): FilterRPC { - const res = proto.FilterRPC.decode(Reader.create(bytes)); + const res = proto.FilterRPC.decode(bytes); return new FilterRPC(res); } @@ -45,7 +44,7 @@ export class FilterRPC { * @returns Uint8Array */ encode(): Uint8Array { - return proto.FilterRPC.encode(this.proto).finish(); + return proto.FilterRPC.encode(this.proto); } get push(): proto.MessagePush | undefined { diff --git a/src/lib/waku_filter/index.ts b/src/lib/waku_filter/index.ts index 6e7a2af37b..77076be9ca 100644 --- a/src/lib/waku_filter/index.ts +++ b/src/lib/waku_filter/index.ts @@ -4,7 +4,7 @@ import { pipe } from "it-pipe"; import Libp2p, { MuxedStream } from "libp2p"; import { Peer, PeerId } from "libp2p/src/peer-store"; -import { WakuMessage as WakuMessageProto } from "../../proto/waku/v2/message"; +import { WakuMessage as WakuMessageProto } from "../../proto/message"; import { DefaultPubSubTopic } from "../constants"; import { getPeersForProtocol, selectRandomPeer } from "../select_peer"; import { hexToBytes } from "../utils"; diff --git a/src/lib/waku_light_push/index.ts b/src/lib/waku_light_push/index.ts index 12ee971c0a..dd2c0cce14 100644 --- a/src/lib/waku_light_push/index.ts +++ b/src/lib/waku_light_push/index.ts @@ -5,7 +5,7 @@ import Libp2p from "libp2p"; import { Peer } from "libp2p/src/peer-store"; import PeerId from "peer-id"; -import { PushResponse } from "../../proto/waku/v2/light_push"; +import { PushResponse } from "../../proto/light_push"; import { DefaultPubSubTopic } from "../constants"; import { getPeersForProtocol, selectRandomPeer } from "../select_peer"; import { WakuMessage } from "../waku_message"; diff --git a/src/lib/waku_light_push/push_rpc.ts b/src/lib/waku_light_push/push_rpc.ts index 12b8f7b87d..b3d808f75e 100644 --- a/src/lib/waku_light_push/push_rpc.ts +++ b/src/lib/waku_light_push/push_rpc.ts @@ -1,11 +1,8 @@ -import protobufjs from "protobufjs/minimal"; import { v4 as uuid } from "uuid"; -import * as proto from "../../proto/waku/v2/light_push"; +import * as proto from "../../proto/light_push"; import { WakuMessage } from "../waku_message"; -const { Reader } = protobufjs; - export class PushRPC { public constructor(public proto: proto.PushRPC) {} @@ -21,12 +18,12 @@ export class PushRPC { } static decode(bytes: Uint8Array): PushRPC { - const res = proto.PushRPC.decode(Reader.create(bytes)); + const res = proto.PushRPC.decode(bytes); return new PushRPC(res); } encode(): Uint8Array { - return proto.PushRPC.encode(this.proto).finish(); + return proto.PushRPC.encode(this.proto); } get query(): proto.PushRequest | undefined { diff --git a/src/lib/waku_message/index.ts b/src/lib/waku_message/index.ts index 47b1fd77c7..2368fc5960 100644 --- a/src/lib/waku_message/index.ts +++ b/src/lib/waku_message/index.ts @@ -1,13 +1,10 @@ import debug from "debug"; -import Long from "long"; -import protobufjs from "protobufjs/minimal"; -import * as proto from "../../proto/waku/v2/message"; +import * as proto from "../../proto/message"; import { bytesToUtf8, utf8ToBytes } from "../utils"; import * as version_1 from "./version_1"; -const { Reader } = protobufjs; const DefaultVersion = 0; const dbg = debug("waku:message"); @@ -106,7 +103,7 @@ export class WakuMessage { payload: _payload, timestampDeprecated: timestamp.valueOf() / 1000, // milliseconds 10^-3 to nanoseconds 10^-9 - timestamp: Long.fromNumber(timestamp.valueOf()).mul(1_000_000), + timestamp: BigInt(timestamp.valueOf()) * BigInt(1_000_000), version, contentTopic, }, @@ -132,7 +129,7 @@ export class WakuMessage { contentTopic?: string[]; }> ): Promise { - const protoBuf = proto.WakuMessage.decode(Reader.create(bytes)); + const protoBuf = proto.WakuMessage.decode(bytes); return WakuMessage.decodeProto(protoBuf, decryptionKeys); } @@ -249,7 +246,7 @@ export class WakuMessage { } encode(): Uint8Array { - return proto.WakuMessage.encode(this.proto).finish(); + return proto.WakuMessage.encode(this.proto); } get payloadAsUtf8(): string { @@ -286,8 +283,8 @@ export class WakuMessage { try { if (this.proto.timestamp) { // nanoseconds 10^-9 to milliseconds 10^-3 - const timestamp = this.proto.timestamp.div(1_000_000).toNumber(); - return new Date(timestamp); + const timestamp = this.proto.timestamp / BigInt(1_000_000); + return new Date(Number(timestamp)); } if (this.proto.timestampDeprecated) { diff --git a/src/lib/waku_store/history_rpc.ts b/src/lib/waku_store/history_rpc.ts index 35fd60fe65..448c5b44af 100644 --- a/src/lib/waku_store/history_rpc.ts +++ b/src/lib/waku_store/history_rpc.ts @@ -1,13 +1,11 @@ -import Long from "long"; -import protobufjs from "protobufjs/minimal"; import { v4 as uuid } from "uuid"; -import * as protoV2Beta3 from "../../proto/waku/v2/store/v2beta3/store"; -import * as protoV2Beta4 from "../../proto/waku/v2/store/v2beta4/store"; +import * as protoV2Beta3 from "../../proto/store_v2beta3"; +import * as protoV2Beta4 from "../../proto/store_v2beta4"; import { StoreCodecs } from "./constants"; -const { Reader } = protobufjs; +const OneMillion = BigInt(1_000_000); export enum PageDirection { BACKWARD = "backward", @@ -26,7 +24,9 @@ export interface Params { } export class HistoryRPC { - private readonly protoCodec: any; + private readonly historyRpc: + | typeof protoV2Beta3.HistoryRPC + | typeof protoV2Beta4.HistoryRPC; private constructor( public readonly proto: protoV2Beta3.HistoryRPC | protoV2Beta4.HistoryRPC, @@ -34,10 +34,10 @@ export class HistoryRPC { ) { switch (storeCodec) { case StoreCodecs.V2Beta3: - this.protoCodec = protoV2Beta3; + this.historyRpc = protoV2Beta3.HistoryRPC; break; case StoreCodecs.V2Beta4: - this.protoCodec = protoV2Beta4; + this.historyRpc = protoV2Beta4.HistoryRPC; break; default: throw `Internal Error: Unexpected store codec value received in constructor: ${storeCodec}`; @@ -75,7 +75,7 @@ export class HistoryRPC { // Using function to scope variables return ((): HistoryRPC => { const pagingInfo = { - pageSize: Long.fromNumber(params.pageSize), + pageSize: BigInt(params.pageSize), cursor: params.cursor, direction, } as protoV2Beta3.PagingInfo; @@ -103,7 +103,7 @@ export class HistoryRPC { case StoreCodecs.V2Beta4: return ((): HistoryRPC => { const pagingInfo = { - pageSize: Long.fromNumber(params.pageSize), + pageSize: BigInt(params.pageSize), cursor: params.cursor, direction, } as protoV2Beta4.PagingInfo; @@ -111,14 +111,12 @@ export class HistoryRPC { let startTime, endTime; if (params.startTime) { // milliseconds 10^-3 to nanoseconds 10^-9 - startTime = Long.fromNumber(params.startTime.valueOf()).mul( - 1_000_000 - ); + startTime = BigInt(params.startTime.valueOf()) * OneMillion; } if (params.endTime) { // milliseconds 10^-3 to nanoseconds 10^-9 - endTime = Long.fromNumber(params.endTime.valueOf()).mul(1_000_000); + endTime = BigInt(params.endTime.valueOf()) * OneMillion; } return new HistoryRPC( { @@ -142,24 +140,24 @@ export class HistoryRPC { } decode(bytes: Uint8Array): HistoryRPC { - const res = this.protoCodec.HistoryRPC.decode(Reader.create(bytes)); + const res = this.historyRpc.decode(bytes); return new HistoryRPC(res, this.storeCodec); } encode(): Uint8Array { - return this.protoCodec.HistoryRPC.encode(this.proto).finish(); + return this.historyRpc.encode(this.proto as any); } } function directionToProto( pageDirection: PageDirection -): protoV2Beta4.PagingInfo_Direction { +): protoV2Beta4.PagingInfo.Direction { switch (pageDirection) { case PageDirection.BACKWARD: - return protoV2Beta4.PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED; + return protoV2Beta4.PagingInfo.Direction.DIRECTION_BACKWARD_UNSPECIFIED; case PageDirection.FORWARD: - return protoV2Beta4.PagingInfo_Direction.DIRECTION_FORWARD; + return protoV2Beta4.PagingInfo.Direction.DIRECTION_FORWARD; default: - return protoV2Beta4.PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED; + return protoV2Beta4.PagingInfo.Direction.DIRECTION_BACKWARD_UNSPECIFIED; } } diff --git a/src/lib/waku_store/index.ts b/src/lib/waku_store/index.ts index 9b8b6afb49..36f5e15b8f 100644 --- a/src/lib/waku_store/index.ts +++ b/src/lib/waku_store/index.ts @@ -6,6 +6,7 @@ import Libp2p from "libp2p"; import { Peer } from "libp2p/src/peer-store"; import PeerId from "peer-id"; +import * as protoV2Beta4 from "../../proto/store_v2beta4"; import { DefaultPubSubTopic, StoreCodecs } from "../constants"; import { getPeersForProtocol, selectRandomPeer } from "../select_peer"; import { hexToBytes } from "../utils"; @@ -211,11 +212,12 @@ export class WakuStore { ); const reply = historyRpcQuery.decode(res.slice()); - const response = reply.response; - if (!response) { + if (!reply.response) { throw "History response misses response field"; } + const response = reply.response as protoV2Beta4.HistoryResponse; + if (response.error) { throw "History response contains an Error" + response.error; } diff --git a/proto/waku/v2/filter.proto b/src/proto/filter.proto similarity index 74% rename from proto/waku/v2/filter.proto rename to src/proto/filter.proto index 2ab26e2dee..369d369560 100644 --- a/proto/waku/v2/filter.proto +++ b/src/proto/filter.proto @@ -1,8 +1,6 @@ syntax = "proto3"; -package waku.v2; - -import "waku/v2/message.proto"; +import "message.proto"; message FilterRequest { bool subscribe = 1; @@ -20,6 +18,6 @@ message MessagePush { message FilterRPC { string request_id = 1; - FilterRequest request = 2; - MessagePush push = 3; -} \ No newline at end of file + optional FilterRequest request = 2; + optional MessagePush push = 3; +} diff --git a/src/proto/filter.ts b/src/proto/filter.ts new file mode 100644 index 0000000000..ea8911ac25 --- /dev/null +++ b/src/proto/filter.ts @@ -0,0 +1,135 @@ +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-namespace */ + +import { + encodeMessage, + decodeMessage, + message, + string, + bool, + bytes, + uint32, + double, + sint64, +} from "protons-runtime"; +import type { Codec } from "protons-runtime"; + +export interface FilterRequest { + subscribe: boolean; + topic: string; + contentFilters: FilterRequest.ContentFilter[]; +} + +export namespace FilterRequest { + export interface ContentFilter { + contentTopic: string; + } + + export namespace ContentFilter { + export const codec = (): Codec => { + return message({ + 1: { name: "contentTopic", codec: string }, + }); + }; + + export const encode = (obj: ContentFilter): Uint8Array => { + return encodeMessage(obj, ContentFilter.codec()); + }; + + export const decode = (buf: Uint8Array): ContentFilter => { + return decodeMessage(buf, ContentFilter.codec()); + }; + } + + export const codec = (): Codec => { + return message({ + 1: { name: "subscribe", codec: bool }, + 2: { name: "topic", codec: string }, + 3: { + name: "contentFilters", + codec: FilterRequest.ContentFilter.codec(), + repeats: true, + }, + }); + }; + + export const encode = (obj: FilterRequest): Uint8Array => { + return encodeMessage(obj, FilterRequest.codec()); + }; + + export const decode = (buf: Uint8Array): FilterRequest => { + return decodeMessage(buf, FilterRequest.codec()); + }; +} + +export interface MessagePush { + messages: WakuMessage[]; +} + +export namespace MessagePush { + export const codec = (): Codec => { + return message({ + 1: { name: "messages", codec: WakuMessage.codec(), repeats: true }, + }); + }; + + export const encode = (obj: MessagePush): Uint8Array => { + return encodeMessage(obj, MessagePush.codec()); + }; + + export const decode = (buf: Uint8Array): MessagePush => { + return decodeMessage(buf, MessagePush.codec()); + }; +} + +export interface FilterRPC { + requestId: string; + request?: FilterRequest; + push?: MessagePush; +} + +export namespace FilterRPC { + export const codec = (): Codec => { + return message({ + 1: { name: "requestId", codec: string }, + 2: { name: "request", codec: FilterRequest.codec(), optional: true }, + 3: { name: "push", codec: MessagePush.codec(), optional: true }, + }); + }; + + export const encode = (obj: FilterRPC): Uint8Array => { + return encodeMessage(obj, FilterRPC.codec()); + }; + + export const decode = (buf: Uint8Array): FilterRPC => { + return decodeMessage(buf, FilterRPC.codec()); + }; +} + +export interface WakuMessage { + payload?: Uint8Array; + contentTopic?: string; + version?: number; + timestampDeprecated?: number; + timestamp?: bigint; +} + +export namespace WakuMessage { + export const codec = (): Codec => { + return message({ + 1: { name: "payload", codec: bytes, optional: true }, + 2: { name: "contentTopic", codec: string, optional: true }, + 3: { name: "version", codec: uint32, optional: true }, + 4: { name: "timestampDeprecated", codec: double, optional: true }, + 10: { name: "timestamp", codec: sint64, optional: true }, + }); + }; + + export const encode = (obj: WakuMessage): Uint8Array => { + return encodeMessage(obj, WakuMessage.codec()); + }; + + export const decode = (buf: Uint8Array): WakuMessage => { + return decodeMessage(buf, WakuMessage.codec()); + }; +} diff --git a/proto/waku/v2/light_push.proto b/src/proto/light_push.proto similarity index 66% rename from proto/waku/v2/light_push.proto rename to src/proto/light_push.proto index 6ec111db71..7d52944317 100644 --- a/proto/waku/v2/light_push.proto +++ b/src/proto/light_push.proto @@ -1,8 +1,6 @@ syntax = "proto3"; -package waku.v2; - -import "waku/v2/message.proto"; +import "message.proto"; message PushRequest { string pub_sub_topic = 1; @@ -16,6 +14,6 @@ message PushResponse { message PushRPC { string request_id = 1; - PushRequest request = 2; - PushResponse response = 3; + optional PushRequest request = 2; + optional PushResponse response = 3; } diff --git a/src/proto/light_push.ts b/src/proto/light_push.ts new file mode 100644 index 0000000000..2081fd2f98 --- /dev/null +++ b/src/proto/light_push.ts @@ -0,0 +1,111 @@ +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-namespace */ + +import { + encodeMessage, + decodeMessage, + message, + string, + bool, + bytes, + uint32, + double, + sint64, +} from "protons-runtime"; +import type { Codec } from "protons-runtime"; + +export interface PushRequest { + pubSubTopic: string; + message: WakuMessage; +} + +export namespace PushRequest { + export const codec = (): Codec => { + return message({ + 1: { name: "pubSubTopic", codec: string }, + 2: { name: "message", codec: WakuMessage.codec() }, + }); + }; + + export const encode = (obj: PushRequest): Uint8Array => { + return encodeMessage(obj, PushRequest.codec()); + }; + + export const decode = (buf: Uint8Array): PushRequest => { + return decodeMessage(buf, PushRequest.codec()); + }; +} + +export interface PushResponse { + isSuccess: boolean; + info: string; +} + +export namespace PushResponse { + export const codec = (): Codec => { + return message({ + 1: { name: "isSuccess", codec: bool }, + 2: { name: "info", codec: string }, + }); + }; + + export const encode = (obj: PushResponse): Uint8Array => { + return encodeMessage(obj, PushResponse.codec()); + }; + + export const decode = (buf: Uint8Array): PushResponse => { + return decodeMessage(buf, PushResponse.codec()); + }; +} + +export interface PushRPC { + requestId: string; + request?: PushRequest; + response?: PushResponse; +} + +export namespace PushRPC { + export const codec = (): Codec => { + return message({ + 1: { name: "requestId", codec: string }, + 2: { name: "request", codec: PushRequest.codec(), optional: true }, + 3: { name: "response", codec: PushResponse.codec(), optional: true }, + }); + }; + + export const encode = (obj: PushRPC): Uint8Array => { + return encodeMessage(obj, PushRPC.codec()); + }; + + export const decode = (buf: Uint8Array): PushRPC => { + return decodeMessage(buf, PushRPC.codec()); + }; +} + +export interface WakuMessage { + payload?: Uint8Array; + contentTopic?: string; + version?: number; + timestampDeprecated?: number; + timestamp?: bigint; +} + +export namespace WakuMessage { + export const codec = (): Codec => { + return message({ + 1: { name: "payload", codec: bytes, optional: true }, + 2: { name: "contentTopic", codec: string, optional: true }, + 3: { name: "version", codec: uint32, optional: true }, + 4: { name: "timestampDeprecated", codec: double, optional: true }, + 10: { name: "timestamp", codec: sint64, optional: true }, + }); + }; + + export const encode = (obj: WakuMessage): Uint8Array => { + return encodeMessage(obj, WakuMessage.codec()); + }; + + export const decode = (buf: Uint8Array): WakuMessage => { + return decodeMessage(buf, WakuMessage.codec()); + }; +} diff --git a/proto/waku/v2/message.proto b/src/proto/message.proto similarity index 92% rename from proto/waku/v2/message.proto rename to src/proto/message.proto index 6142752e9e..25a8e0c3ac 100644 --- a/proto/waku/v2/message.proto +++ b/src/proto/message.proto @@ -1,7 +1,5 @@ syntax = "proto3"; -package waku.v2; - message WakuMessage { optional bytes payload = 1; optional string content_topic = 2; diff --git a/src/proto/message.ts b/src/proto/message.ts new file mode 100644 index 0000000000..0a57c5d9df --- /dev/null +++ b/src/proto/message.ts @@ -0,0 +1,42 @@ +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-namespace */ + +import { + encodeMessage, + decodeMessage, + message, + bytes, + string, + uint32, + double, + sint64, +} from "protons-runtime"; +import type { Codec } from "protons-runtime"; + +export interface WakuMessage { + payload?: Uint8Array; + contentTopic?: string; + version?: number; + timestampDeprecated?: number; + timestamp?: bigint; +} + +export namespace WakuMessage { + export const codec = (): Codec => { + return message({ + 1: { name: "payload", codec: bytes, optional: true }, + 2: { name: "contentTopic", codec: string, optional: true }, + 3: { name: "version", codec: uint32, optional: true }, + 4: { name: "timestampDeprecated", codec: double, optional: true }, + 10: { name: "timestamp", codec: sint64, optional: true }, + }); + }; + + export const encode = (obj: WakuMessage): Uint8Array => { + return encodeMessage(obj, WakuMessage.codec()); + }; + + export const decode = (buf: Uint8Array): WakuMessage => { + return decodeMessage(buf, WakuMessage.codec()); + }; +} diff --git a/proto/waku/v2/store/v2beta3/store.proto b/src/proto/store_v2beta3.proto similarity index 86% rename from proto/waku/v2/store/v2beta3/store.proto rename to src/proto/store_v2beta3.proto index c2eb65e28e..2ac4139754 100644 --- a/proto/waku/v2/store/v2beta3/store.proto +++ b/src/proto/store_v2beta3.proto @@ -1,8 +1,6 @@ syntax = "proto3"; -package waku.v2.store.v2beta3; - -import "waku/v2/message.proto"; +import "message.proto"; message Index { bytes digest = 1; @@ -44,6 +42,6 @@ message HistoryResponse { message HistoryRPC { string request_id = 1; - HistoryQuery query = 2; - HistoryResponse response = 3; + optional HistoryQuery query = 2; + optional HistoryResponse response = 3; } diff --git a/src/proto/store_v2beta3.ts b/src/proto/store_v2beta3.ts new file mode 100644 index 0000000000..f92bde640a --- /dev/null +++ b/src/proto/store_v2beta3.ts @@ -0,0 +1,224 @@ +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-namespace */ + +import { + encodeMessage, + decodeMessage, + message, + bytes, + double, + enumeration, + uint64, + string, + uint32, + sint64, +} from "protons-runtime"; +import type { Codec } from "protons-runtime"; + +export interface Index { + digest: Uint8Array; + receivedTime: number; + senderTime: number; +} + +export namespace Index { + export const codec = (): Codec => { + return message({ + 1: { name: "digest", codec: bytes }, + 2: { name: "receivedTime", codec: double }, + 3: { name: "senderTime", codec: double }, + }); + }; + + export const encode = (obj: Index): Uint8Array => { + return encodeMessage(obj, Index.codec()); + }; + + export const decode = (buf: Uint8Array): Index => { + return decodeMessage(buf, Index.codec()); + }; +} + +export interface PagingInfo { + pageSize: bigint; + cursor: Index; + direction: PagingInfo.Direction; +} + +export namespace PagingInfo { + export enum Direction { + DIRECTION_BACKWARD_UNSPECIFIED = "DIRECTION_BACKWARD_UNSPECIFIED", + DIRECTION_FORWARD = "DIRECTION_FORWARD", + } + + enum __DirectionValues { + DIRECTION_BACKWARD_UNSPECIFIED = 0, + DIRECTION_FORWARD = 1, + } + + export namespace Direction { + export const codec = () => { + return enumeration(__DirectionValues); + }; + } + + export const codec = (): Codec => { + return message({ + 1: { name: "pageSize", codec: uint64 }, + 2: { name: "cursor", codec: Index.codec() }, + 3: { name: "direction", codec: PagingInfo.Direction.codec() }, + }); + }; + + export const encode = (obj: PagingInfo): Uint8Array => { + return encodeMessage(obj, PagingInfo.codec()); + }; + + export const decode = (buf: Uint8Array): PagingInfo => { + return decodeMessage(buf, PagingInfo.codec()); + }; +} + +export interface ContentFilter { + contentTopic: string; +} + +export namespace ContentFilter { + export const codec = (): Codec => { + return message({ + 1: { name: "contentTopic", codec: string }, + }); + }; + + export const encode = (obj: ContentFilter): Uint8Array => { + return encodeMessage(obj, ContentFilter.codec()); + }; + + export const decode = (buf: Uint8Array): ContentFilter => { + return decodeMessage(buf, ContentFilter.codec()); + }; +} + +export interface HistoryQuery { + pubSubTopic?: string; + contentFilters: ContentFilter[]; + pagingInfo?: PagingInfo; + startTime?: number; + endTime?: number; +} + +export namespace HistoryQuery { + export const codec = (): Codec => { + return message({ + 2: { name: "pubSubTopic", codec: string, optional: true }, + 3: { + name: "contentFilters", + codec: ContentFilter.codec(), + repeats: true, + }, + 4: { name: "pagingInfo", codec: PagingInfo.codec(), optional: true }, + 5: { name: "startTime", codec: double, optional: true }, + 6: { name: "endTime", codec: double, optional: true }, + }); + }; + + export const encode = (obj: HistoryQuery): Uint8Array => { + return encodeMessage(obj, HistoryQuery.codec()); + }; + + export const decode = (buf: Uint8Array): HistoryQuery => { + return decodeMessage(buf, HistoryQuery.codec()); + }; +} + +export interface HistoryResponse { + messages: WakuMessage[]; + pagingInfo: PagingInfo; + error: HistoryResponse.Error; +} + +export namespace HistoryResponse { + export enum Error { + ERROR_NONE_UNSPECIFIED = "ERROR_NONE_UNSPECIFIED", + ERROR_INVALID_CURSOR = "ERROR_INVALID_CURSOR", + } + + enum __ErrorValues { + ERROR_NONE_UNSPECIFIED = 0, + ERROR_INVALID_CURSOR = 1, + } + + export namespace Error { + export const codec = () => { + return enumeration(__ErrorValues); + }; + } + + export const codec = (): Codec => { + return message({ + 2: { name: "messages", codec: WakuMessage.codec(), repeats: true }, + 3: { name: "pagingInfo", codec: PagingInfo.codec() }, + 4: { name: "error", codec: HistoryResponse.Error.codec() }, + }); + }; + + export const encode = (obj: HistoryResponse): Uint8Array => { + return encodeMessage(obj, HistoryResponse.codec()); + }; + + export const decode = (buf: Uint8Array): HistoryResponse => { + return decodeMessage(buf, HistoryResponse.codec()); + }; +} + +export interface HistoryRPC { + requestId: string; + query?: HistoryQuery; + response?: HistoryResponse; +} + +export namespace HistoryRPC { + export const codec = (): Codec => { + return message({ + 1: { name: "requestId", codec: string }, + 2: { name: "query", codec: HistoryQuery.codec(), optional: true }, + 3: { name: "response", codec: HistoryResponse.codec(), optional: true }, + }); + }; + + export const encode = (obj: HistoryRPC): Uint8Array => { + return encodeMessage(obj, HistoryRPC.codec()); + }; + + export const decode = (buf: Uint8Array): HistoryRPC => { + return decodeMessage(buf, HistoryRPC.codec()); + }; +} + +export interface WakuMessage { + payload?: Uint8Array; + contentTopic?: string; + version?: number; + timestampDeprecated?: number; + timestamp?: bigint; +} + +export namespace WakuMessage { + export const codec = (): Codec => { + return message({ + 1: { name: "payload", codec: bytes, optional: true }, + 2: { name: "contentTopic", codec: string, optional: true }, + 3: { name: "version", codec: uint32, optional: true }, + 4: { name: "timestampDeprecated", codec: double, optional: true }, + 10: { name: "timestamp", codec: sint64, optional: true }, + }); + }; + + export const encode = (obj: WakuMessage): Uint8Array => { + return encodeMessage(obj, WakuMessage.codec()); + }; + + export const decode = (buf: Uint8Array): WakuMessage => { + return decodeMessage(buf, WakuMessage.codec()); + }; +} diff --git a/proto/waku/v2/store/v2beta4/store.proto b/src/proto/store_v2beta4.proto similarity index 87% rename from proto/waku/v2/store/v2beta4/store.proto rename to src/proto/store_v2beta4.proto index 0a72ec6f09..3166dc588b 100644 --- a/proto/waku/v2/store/v2beta4/store.proto +++ b/src/proto/store_v2beta4.proto @@ -1,8 +1,6 @@ syntax = "proto3"; -package waku.v2.store.v2beta4; - -import "waku/v2/message.proto"; +import "message.proto"; message Index { bytes digest = 1; @@ -45,6 +43,6 @@ message HistoryResponse { message HistoryRPC { string request_id = 1; - HistoryQuery query = 2; - HistoryResponse response = 3; + optional HistoryQuery query = 2; + optional HistoryResponse response = 3; } diff --git a/src/proto/store_v2beta4.ts b/src/proto/store_v2beta4.ts new file mode 100644 index 0000000000..7a5adedd22 --- /dev/null +++ b/src/proto/store_v2beta4.ts @@ -0,0 +1,226 @@ +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-namespace */ + +import { + encodeMessage, + decodeMessage, + message, + bytes, + sint64, + string, + enumeration, + uint64, + uint32, + double, +} from "protons-runtime"; +import type { Codec } from "protons-runtime"; + +export interface Index { + digest: Uint8Array; + receivedTime: bigint; + senderTime: bigint; + pubsubTopic: string; +} + +export namespace Index { + export const codec = (): Codec => { + return message({ + 1: { name: "digest", codec: bytes }, + 2: { name: "receivedTime", codec: sint64 }, + 3: { name: "senderTime", codec: sint64 }, + 4: { name: "pubsubTopic", codec: string }, + }); + }; + + export const encode = (obj: Index): Uint8Array => { + return encodeMessage(obj, Index.codec()); + }; + + export const decode = (buf: Uint8Array): Index => { + return decodeMessage(buf, Index.codec()); + }; +} + +export interface PagingInfo { + pageSize: bigint; + cursor: Index; + direction: PagingInfo.Direction; +} + +export namespace PagingInfo { + export enum Direction { + DIRECTION_BACKWARD_UNSPECIFIED = "DIRECTION_BACKWARD_UNSPECIFIED", + DIRECTION_FORWARD = "DIRECTION_FORWARD", + } + + enum __DirectionValues { + DIRECTION_BACKWARD_UNSPECIFIED = 0, + DIRECTION_FORWARD = 1, + } + + export namespace Direction { + export const codec = () => { + return enumeration(__DirectionValues); + }; + } + + export const codec = (): Codec => { + return message({ + 1: { name: "pageSize", codec: uint64 }, + 2: { name: "cursor", codec: Index.codec() }, + 3: { name: "direction", codec: PagingInfo.Direction.codec() }, + }); + }; + + export const encode = (obj: PagingInfo): Uint8Array => { + return encodeMessage(obj, PagingInfo.codec()); + }; + + export const decode = (buf: Uint8Array): PagingInfo => { + return decodeMessage(buf, PagingInfo.codec()); + }; +} + +export interface ContentFilter { + contentTopic: string; +} + +export namespace ContentFilter { + export const codec = (): Codec => { + return message({ + 1: { name: "contentTopic", codec: string }, + }); + }; + + export const encode = (obj: ContentFilter): Uint8Array => { + return encodeMessage(obj, ContentFilter.codec()); + }; + + export const decode = (buf: Uint8Array): ContentFilter => { + return decodeMessage(buf, ContentFilter.codec()); + }; +} + +export interface HistoryQuery { + pubSubTopic?: string; + contentFilters: ContentFilter[]; + pagingInfo?: PagingInfo; + startTime?: bigint; + endTime?: bigint; +} + +export namespace HistoryQuery { + export const codec = (): Codec => { + return message({ + 2: { name: "pubSubTopic", codec: string, optional: true }, + 3: { + name: "contentFilters", + codec: ContentFilter.codec(), + repeats: true, + }, + 4: { name: "pagingInfo", codec: PagingInfo.codec(), optional: true }, + 5: { name: "startTime", codec: sint64, optional: true }, + 6: { name: "endTime", codec: sint64, optional: true }, + }); + }; + + export const encode = (obj: HistoryQuery): Uint8Array => { + return encodeMessage(obj, HistoryQuery.codec()); + }; + + export const decode = (buf: Uint8Array): HistoryQuery => { + return decodeMessage(buf, HistoryQuery.codec()); + }; +} + +export interface HistoryResponse { + messages: WakuMessage[]; + pagingInfo: PagingInfo; + error: HistoryResponse.Error; +} + +export namespace HistoryResponse { + export enum Error { + ERROR_NONE_UNSPECIFIED = "ERROR_NONE_UNSPECIFIED", + ERROR_INVALID_CURSOR = "ERROR_INVALID_CURSOR", + } + + enum __ErrorValues { + ERROR_NONE_UNSPECIFIED = 0, + ERROR_INVALID_CURSOR = 1, + } + + export namespace Error { + export const codec = () => { + return enumeration(__ErrorValues); + }; + } + + export const codec = (): Codec => { + return message({ + 2: { name: "messages", codec: WakuMessage.codec(), repeats: true }, + 3: { name: "pagingInfo", codec: PagingInfo.codec() }, + 4: { name: "error", codec: HistoryResponse.Error.codec() }, + }); + }; + + export const encode = (obj: HistoryResponse): Uint8Array => { + return encodeMessage(obj, HistoryResponse.codec()); + }; + + export const decode = (buf: Uint8Array): HistoryResponse => { + return decodeMessage(buf, HistoryResponse.codec()); + }; +} + +export interface HistoryRPC { + requestId: string; + query?: HistoryQuery; + response?: HistoryResponse; +} + +export namespace HistoryRPC { + export const codec = (): Codec => { + return message({ + 1: { name: "requestId", codec: string }, + 2: { name: "query", codec: HistoryQuery.codec(), optional: true }, + 3: { name: "response", codec: HistoryResponse.codec(), optional: true }, + }); + }; + + export const encode = (obj: HistoryRPC): Uint8Array => { + return encodeMessage(obj, HistoryRPC.codec()); + }; + + export const decode = (buf: Uint8Array): HistoryRPC => { + return decodeMessage(buf, HistoryRPC.codec()); + }; +} + +export interface WakuMessage { + payload?: Uint8Array; + contentTopic?: string; + version?: number; + timestampDeprecated?: number; + timestamp?: bigint; +} + +export namespace WakuMessage { + export const codec = (): Codec => { + return message({ + 1: { name: "payload", codec: bytes, optional: true }, + 2: { name: "contentTopic", codec: string, optional: true }, + 3: { name: "version", codec: uint32, optional: true }, + 4: { name: "timestampDeprecated", codec: double, optional: true }, + 10: { name: "timestamp", codec: sint64, optional: true }, + }); + }; + + export const encode = (obj: WakuMessage): Uint8Array => { + return encodeMessage(obj, WakuMessage.codec()); + }; + + export const decode = (buf: Uint8Array): WakuMessage => { + return decodeMessage(buf, WakuMessage.codec()); + }; +} diff --git a/src/proto/waku/v2/filter.ts b/src/proto/waku/v2/filter.ts deleted file mode 100644 index 97ab03a3d9..0000000000 --- a/src/proto/waku/v2/filter.ts +++ /dev/null @@ -1,358 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { WakuMessage } from "../../waku/v2/message"; - -export const protobufPackage = "waku.v2"; - -export interface FilterRequest { - subscribe: boolean; - topic: string; - contentFilters: FilterRequest_ContentFilter[]; -} - -export interface FilterRequest_ContentFilter { - contentTopic: string; -} - -export interface MessagePush { - messages: WakuMessage[]; -} - -export interface FilterRPC { - requestId: string; - request: FilterRequest | undefined; - push: MessagePush | undefined; -} - -function createBaseFilterRequest(): FilterRequest { - return { subscribe: false, topic: "", contentFilters: [] }; -} - -export const FilterRequest = { - encode( - message: FilterRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.subscribe === true) { - writer.uint32(8).bool(message.subscribe); - } - if (message.topic !== "") { - writer.uint32(18).string(message.topic); - } - for (const v of message.contentFilters) { - FilterRequest_ContentFilter.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FilterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFilterRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscribe = reader.bool(); - break; - case 2: - message.topic = reader.string(); - break; - case 3: - message.contentFilters.push( - FilterRequest_ContentFilter.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FilterRequest { - return { - subscribe: isSet(object.subscribe) ? Boolean(object.subscribe) : false, - topic: isSet(object.topic) ? String(object.topic) : "", - contentFilters: Array.isArray(object?.contentFilters) - ? object.contentFilters.map((e: any) => - FilterRequest_ContentFilter.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: FilterRequest): unknown { - const obj: any = {}; - message.subscribe !== undefined && (obj.subscribe = message.subscribe); - message.topic !== undefined && (obj.topic = message.topic); - if (message.contentFilters) { - obj.contentFilters = message.contentFilters.map((e) => - e ? FilterRequest_ContentFilter.toJSON(e) : undefined - ); - } else { - obj.contentFilters = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): FilterRequest { - const message = createBaseFilterRequest(); - message.subscribe = object.subscribe ?? false; - message.topic = object.topic ?? ""; - message.contentFilters = - object.contentFilters?.map((e) => - FilterRequest_ContentFilter.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseFilterRequest_ContentFilter(): FilterRequest_ContentFilter { - return { contentTopic: "" }; -} - -export const FilterRequest_ContentFilter = { - encode( - message: FilterRequest_ContentFilter, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.contentTopic !== "") { - writer.uint32(10).string(message.contentTopic); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): FilterRequest_ContentFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFilterRequest_ContentFilter(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contentTopic = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FilterRequest_ContentFilter { - return { - contentTopic: isSet(object.contentTopic) - ? String(object.contentTopic) - : "", - }; - }, - - toJSON(message: FilterRequest_ContentFilter): unknown { - const obj: any = {}; - message.contentTopic !== undefined && - (obj.contentTopic = message.contentTopic); - return obj; - }, - - fromPartial, I>>( - object: I - ): FilterRequest_ContentFilter { - const message = createBaseFilterRequest_ContentFilter(); - message.contentTopic = object.contentTopic ?? ""; - return message; - }, -}; - -function createBaseMessagePush(): MessagePush { - return { messages: [] }; -} - -export const MessagePush = { - encode( - message: MessagePush, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.messages) { - WakuMessage.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MessagePush { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessagePush(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messages.push(WakuMessage.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessagePush { - return { - messages: Array.isArray(object?.messages) - ? object.messages.map((e: any) => WakuMessage.fromJSON(e)) - : [], - }; - }, - - toJSON(message: MessagePush): unknown { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map((e) => - e ? WakuMessage.toJSON(e) : undefined - ); - } else { - obj.messages = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): MessagePush { - const message = createBaseMessagePush(); - message.messages = - object.messages?.map((e) => WakuMessage.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFilterRPC(): FilterRPC { - return { requestId: "", request: undefined, push: undefined }; -} - -export const FilterRPC = { - encode( - message: FilterRPC, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.requestId !== "") { - writer.uint32(10).string(message.requestId); - } - if (message.request !== undefined) { - FilterRequest.encode(message.request, writer.uint32(18).fork()).ldelim(); - } - if (message.push !== undefined) { - MessagePush.encode(message.push, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FilterRPC { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFilterRPC(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.requestId = reader.string(); - break; - case 2: - message.request = FilterRequest.decode(reader, reader.uint32()); - break; - case 3: - message.push = MessagePush.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FilterRPC { - return { - requestId: isSet(object.requestId) ? String(object.requestId) : "", - request: isSet(object.request) - ? FilterRequest.fromJSON(object.request) - : undefined, - push: isSet(object.push) ? MessagePush.fromJSON(object.push) : undefined, - }; - }, - - toJSON(message: FilterRPC): unknown { - const obj: any = {}; - message.requestId !== undefined && (obj.requestId = message.requestId); - message.request !== undefined && - (obj.request = message.request - ? FilterRequest.toJSON(message.request) - : undefined); - message.push !== undefined && - (obj.push = message.push ? MessagePush.toJSON(message.push) : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): FilterRPC { - const message = createBaseFilterRPC(); - message.requestId = object.requestId ?? ""; - message.request = - object.request !== undefined && object.request !== null - ? FilterRequest.fromPartial(object.request) - : undefined; - message.push = - object.push !== undefined && object.push !== null - ? MessagePush.fromPartial(object.push) - : undefined; - return message; - }, -}; - -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto/waku/v2/light_push.ts b/src/proto/waku/v2/light_push.ts deleted file mode 100644 index 7a7977c2b2..0000000000 --- a/src/proto/waku/v2/light_push.ts +++ /dev/null @@ -1,281 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { WakuMessage } from "../../waku/v2/message"; - -export const protobufPackage = "waku.v2"; - -export interface PushRequest { - pubSubTopic: string; - message: WakuMessage | undefined; -} - -export interface PushResponse { - isSuccess: boolean; - info: string; -} - -export interface PushRPC { - requestId: string; - request: PushRequest | undefined; - response: PushResponse | undefined; -} - -function createBasePushRequest(): PushRequest { - return { pubSubTopic: "", message: undefined }; -} - -export const PushRequest = { - encode( - message: PushRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.pubSubTopic !== "") { - writer.uint32(10).string(message.pubSubTopic); - } - if (message.message !== undefined) { - WakuMessage.encode(message.message, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PushRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePushRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pubSubTopic = reader.string(); - break; - case 2: - message.message = WakuMessage.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PushRequest { - return { - pubSubTopic: isSet(object.pubSubTopic) ? String(object.pubSubTopic) : "", - message: isSet(object.message) - ? WakuMessage.fromJSON(object.message) - : undefined, - }; - }, - - toJSON(message: PushRequest): unknown { - const obj: any = {}; - message.pubSubTopic !== undefined && - (obj.pubSubTopic = message.pubSubTopic); - message.message !== undefined && - (obj.message = message.message - ? WakuMessage.toJSON(message.message) - : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): PushRequest { - const message = createBasePushRequest(); - message.pubSubTopic = object.pubSubTopic ?? ""; - message.message = - object.message !== undefined && object.message !== null - ? WakuMessage.fromPartial(object.message) - : undefined; - return message; - }, -}; - -function createBasePushResponse(): PushResponse { - return { isSuccess: false, info: "" }; -} - -export const PushResponse = { - encode( - message: PushResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.isSuccess === true) { - writer.uint32(8).bool(message.isSuccess); - } - if (message.info !== "") { - writer.uint32(18).string(message.info); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PushResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePushResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.isSuccess = reader.bool(); - break; - case 2: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PushResponse { - return { - isSuccess: isSet(object.isSuccess) ? Boolean(object.isSuccess) : false, - info: isSet(object.info) ? String(object.info) : "", - }; - }, - - toJSON(message: PushResponse): unknown { - const obj: any = {}; - message.isSuccess !== undefined && (obj.isSuccess = message.isSuccess); - message.info !== undefined && (obj.info = message.info); - return obj; - }, - - fromPartial, I>>( - object: I - ): PushResponse { - const message = createBasePushResponse(); - message.isSuccess = object.isSuccess ?? false; - message.info = object.info ?? ""; - return message; - }, -}; - -function createBasePushRPC(): PushRPC { - return { requestId: "", request: undefined, response: undefined }; -} - -export const PushRPC = { - encode( - message: PushRPC, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.requestId !== "") { - writer.uint32(10).string(message.requestId); - } - if (message.request !== undefined) { - PushRequest.encode(message.request, writer.uint32(18).fork()).ldelim(); - } - if (message.response !== undefined) { - PushResponse.encode(message.response, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PushRPC { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePushRPC(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.requestId = reader.string(); - break; - case 2: - message.request = PushRequest.decode(reader, reader.uint32()); - break; - case 3: - message.response = PushResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PushRPC { - return { - requestId: isSet(object.requestId) ? String(object.requestId) : "", - request: isSet(object.request) - ? PushRequest.fromJSON(object.request) - : undefined, - response: isSet(object.response) - ? PushResponse.fromJSON(object.response) - : undefined, - }; - }, - - toJSON(message: PushRPC): unknown { - const obj: any = {}; - message.requestId !== undefined && (obj.requestId = message.requestId); - message.request !== undefined && - (obj.request = message.request - ? PushRequest.toJSON(message.request) - : undefined); - message.response !== undefined && - (obj.response = message.response - ? PushResponse.toJSON(message.response) - : undefined); - return obj; - }, - - fromPartial, I>>(object: I): PushRPC { - const message = createBasePushRPC(); - message.requestId = object.requestId ?? ""; - message.request = - object.request !== undefined && object.request !== null - ? PushRequest.fromPartial(object.request) - : undefined; - message.response = - object.response !== undefined && object.response !== null - ? PushResponse.fromPartial(object.response) - : undefined; - return message; - }, -}; - -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto/waku/v2/message.ts b/src/proto/waku/v2/message.ts deleted file mode 100644 index c60ae7528a..0000000000 --- a/src/proto/waku/v2/message.ts +++ /dev/null @@ -1,200 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "waku.v2"; - -export interface WakuMessage { - payload?: Uint8Array | undefined; - contentTopic?: string | undefined; - version?: number | undefined; - timestampDeprecated?: number | undefined; - timestamp?: Long | undefined; -} - -function createBaseWakuMessage(): WakuMessage { - return { - payload: undefined, - contentTopic: undefined, - version: undefined, - timestampDeprecated: undefined, - timestamp: undefined, - }; -} - -export const WakuMessage = { - encode( - message: WakuMessage, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.payload !== undefined) { - writer.uint32(10).bytes(message.payload); - } - if (message.contentTopic !== undefined) { - writer.uint32(18).string(message.contentTopic); - } - if (message.version !== undefined) { - writer.uint32(24).uint32(message.version); - } - if (message.timestampDeprecated !== undefined) { - writer.uint32(33).double(message.timestampDeprecated); - } - if (message.timestamp !== undefined) { - writer.uint32(80).sint64(message.timestamp); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): WakuMessage { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseWakuMessage(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.payload = reader.bytes(); - break; - case 2: - message.contentTopic = reader.string(); - break; - case 3: - message.version = reader.uint32(); - break; - case 4: - message.timestampDeprecated = reader.double(); - break; - case 10: - message.timestamp = reader.sint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): WakuMessage { - return { - payload: isSet(object.payload) - ? bytesFromBase64(object.payload) - : undefined, - contentTopic: isSet(object.contentTopic) - ? String(object.contentTopic) - : undefined, - version: isSet(object.version) ? Number(object.version) : undefined, - timestampDeprecated: isSet(object.timestampDeprecated) - ? Number(object.timestampDeprecated) - : undefined, - timestamp: isSet(object.timestamp) - ? Long.fromString(object.timestamp) - : undefined, - }; - }, - - toJSON(message: WakuMessage): unknown { - const obj: any = {}; - message.payload !== undefined && - (obj.payload = - message.payload !== undefined - ? base64FromBytes(message.payload) - : undefined); - message.contentTopic !== undefined && - (obj.contentTopic = message.contentTopic); - message.version !== undefined && - (obj.version = Math.round(message.version)); - message.timestampDeprecated !== undefined && - (obj.timestampDeprecated = message.timestampDeprecated); - message.timestamp !== undefined && - (obj.timestamp = (message.timestamp || undefined).toString()); - return obj; - }, - - fromPartial, I>>( - object: I - ): WakuMessage { - const message = createBaseWakuMessage(); - message.payload = object.payload ?? undefined; - message.contentTopic = object.contentTopic ?? undefined; - message.version = object.version ?? undefined; - message.timestampDeprecated = object.timestampDeprecated ?? undefined; - message.timestamp = - object.timestamp !== undefined && object.timestamp !== null - ? Long.fromValue(object.timestamp) - : undefined; - return message; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (const byte of arr) { - bin.push(String.fromCharCode(byte)); - } - return btoa(bin.join("")); -} - -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto/waku/v2/store/v2beta3/store.ts b/src/proto/waku/v2/store/v2beta3/store.ts deleted file mode 100644 index 5dfda93966..0000000000 --- a/src/proto/waku/v2/store/v2beta3/store.ts +++ /dev/null @@ -1,704 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { WakuMessage } from "../../../../waku/v2/message"; - -export const protobufPackage = "waku.v2.store.v2beta3"; - -export interface Index { - digest: Uint8Array; - receivedTime: number; - senderTime: number; -} - -export interface PagingInfo { - pageSize: Long; - cursor: Index | undefined; - direction: PagingInfo_Direction; -} - -export enum PagingInfo_Direction { - DIRECTION_BACKWARD_UNSPECIFIED = 0, - DIRECTION_FORWARD = 1, - UNRECOGNIZED = -1, -} - -export function pagingInfo_DirectionFromJSON( - object: any -): PagingInfo_Direction { - switch (object) { - case 0: - case "DIRECTION_BACKWARD_UNSPECIFIED": - return PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED; - case 1: - case "DIRECTION_FORWARD": - return PagingInfo_Direction.DIRECTION_FORWARD; - case -1: - case "UNRECOGNIZED": - default: - return PagingInfo_Direction.UNRECOGNIZED; - } -} - -export function pagingInfo_DirectionToJSON( - object: PagingInfo_Direction -): string { - switch (object) { - case PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED: - return "DIRECTION_BACKWARD_UNSPECIFIED"; - case PagingInfo_Direction.DIRECTION_FORWARD: - return "DIRECTION_FORWARD"; - default: - return "UNKNOWN"; - } -} - -export interface ContentFilter { - contentTopic: string; -} - -export interface HistoryQuery { - pubSubTopic?: string | undefined; - contentFilters: ContentFilter[]; - pagingInfo?: PagingInfo | undefined; - startTime?: number | undefined; - endTime?: number | undefined; -} - -export interface HistoryResponse { - messages: WakuMessage[]; - pagingInfo: PagingInfo | undefined; - error: HistoryResponse_Error; -} - -export enum HistoryResponse_Error { - ERROR_NONE_UNSPECIFIED = 0, - ERROR_INVALID_CURSOR = 1, - UNRECOGNIZED = -1, -} - -export function historyResponse_ErrorFromJSON( - object: any -): HistoryResponse_Error { - switch (object) { - case 0: - case "ERROR_NONE_UNSPECIFIED": - return HistoryResponse_Error.ERROR_NONE_UNSPECIFIED; - case 1: - case "ERROR_INVALID_CURSOR": - return HistoryResponse_Error.ERROR_INVALID_CURSOR; - case -1: - case "UNRECOGNIZED": - default: - return HistoryResponse_Error.UNRECOGNIZED; - } -} - -export function historyResponse_ErrorToJSON( - object: HistoryResponse_Error -): string { - switch (object) { - case HistoryResponse_Error.ERROR_NONE_UNSPECIFIED: - return "ERROR_NONE_UNSPECIFIED"; - case HistoryResponse_Error.ERROR_INVALID_CURSOR: - return "ERROR_INVALID_CURSOR"; - default: - return "UNKNOWN"; - } -} - -export interface HistoryRPC { - requestId: string; - query: HistoryQuery | undefined; - response: HistoryResponse | undefined; -} - -function createBaseIndex(): Index { - return { digest: new Uint8Array(), receivedTime: 0, senderTime: 0 }; -} - -export const Index = { - encode(message: Index, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.digest.length !== 0) { - writer.uint32(10).bytes(message.digest); - } - if (message.receivedTime !== 0) { - writer.uint32(17).double(message.receivedTime); - } - if (message.senderTime !== 0) { - writer.uint32(25).double(message.senderTime); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Index { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIndex(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.digest = reader.bytes(); - break; - case 2: - message.receivedTime = reader.double(); - break; - case 3: - message.senderTime = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Index { - return { - digest: isSet(object.digest) - ? bytesFromBase64(object.digest) - : new Uint8Array(), - receivedTime: isSet(object.receivedTime) - ? Number(object.receivedTime) - : 0, - senderTime: isSet(object.senderTime) ? Number(object.senderTime) : 0, - }; - }, - - toJSON(message: Index): unknown { - const obj: any = {}; - message.digest !== undefined && - (obj.digest = base64FromBytes( - message.digest !== undefined ? message.digest : new Uint8Array() - )); - message.receivedTime !== undefined && - (obj.receivedTime = message.receivedTime); - message.senderTime !== undefined && (obj.senderTime = message.senderTime); - return obj; - }, - - fromPartial, I>>(object: I): Index { - const message = createBaseIndex(); - message.digest = object.digest ?? new Uint8Array(); - message.receivedTime = object.receivedTime ?? 0; - message.senderTime = object.senderTime ?? 0; - return message; - }, -}; - -function createBasePagingInfo(): PagingInfo { - return { pageSize: Long.UZERO, cursor: undefined, direction: 0 }; -} - -export const PagingInfo = { - encode( - message: PagingInfo, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (!message.pageSize.isZero()) { - writer.uint32(8).uint64(message.pageSize); - } - if (message.cursor !== undefined) { - Index.encode(message.cursor, writer.uint32(18).fork()).ldelim(); - } - if (message.direction !== 0) { - writer.uint32(24).int32(message.direction); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PagingInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePagingInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pageSize = reader.uint64() as Long; - break; - case 2: - message.cursor = Index.decode(reader, reader.uint32()); - break; - case 3: - message.direction = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PagingInfo { - return { - pageSize: isSet(object.pageSize) - ? Long.fromString(object.pageSize) - : Long.UZERO, - cursor: isSet(object.cursor) ? Index.fromJSON(object.cursor) : undefined, - direction: isSet(object.direction) - ? pagingInfo_DirectionFromJSON(object.direction) - : 0, - }; - }, - - toJSON(message: PagingInfo): unknown { - const obj: any = {}; - message.pageSize !== undefined && - (obj.pageSize = (message.pageSize || Long.UZERO).toString()); - message.cursor !== undefined && - (obj.cursor = message.cursor ? Index.toJSON(message.cursor) : undefined); - message.direction !== undefined && - (obj.direction = pagingInfo_DirectionToJSON(message.direction)); - return obj; - }, - - fromPartial, I>>( - object: I - ): PagingInfo { - const message = createBasePagingInfo(); - message.pageSize = - object.pageSize !== undefined && object.pageSize !== null - ? Long.fromValue(object.pageSize) - : Long.UZERO; - message.cursor = - object.cursor !== undefined && object.cursor !== null - ? Index.fromPartial(object.cursor) - : undefined; - message.direction = object.direction ?? 0; - return message; - }, -}; - -function createBaseContentFilter(): ContentFilter { - return { contentTopic: "" }; -} - -export const ContentFilter = { - encode( - message: ContentFilter, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.contentTopic !== "") { - writer.uint32(10).string(message.contentTopic); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ContentFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContentFilter(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contentTopic = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ContentFilter { - return { - contentTopic: isSet(object.contentTopic) - ? String(object.contentTopic) - : "", - }; - }, - - toJSON(message: ContentFilter): unknown { - const obj: any = {}; - message.contentTopic !== undefined && - (obj.contentTopic = message.contentTopic); - return obj; - }, - - fromPartial, I>>( - object: I - ): ContentFilter { - const message = createBaseContentFilter(); - message.contentTopic = object.contentTopic ?? ""; - return message; - }, -}; - -function createBaseHistoryQuery(): HistoryQuery { - return { - pubSubTopic: undefined, - contentFilters: [], - pagingInfo: undefined, - startTime: undefined, - endTime: undefined, - }; -} - -export const HistoryQuery = { - encode( - message: HistoryQuery, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.pubSubTopic !== undefined) { - writer.uint32(18).string(message.pubSubTopic); - } - for (const v of message.contentFilters) { - ContentFilter.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.pagingInfo !== undefined) { - PagingInfo.encode(message.pagingInfo, writer.uint32(34).fork()).ldelim(); - } - if (message.startTime !== undefined) { - writer.uint32(41).double(message.startTime); - } - if (message.endTime !== undefined) { - writer.uint32(49).double(message.endTime); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): HistoryQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHistoryQuery(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.pubSubTopic = reader.string(); - break; - case 3: - message.contentFilters.push( - ContentFilter.decode(reader, reader.uint32()) - ); - break; - case 4: - message.pagingInfo = PagingInfo.decode(reader, reader.uint32()); - break; - case 5: - message.startTime = reader.double(); - break; - case 6: - message.endTime = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HistoryQuery { - return { - pubSubTopic: isSet(object.pubSubTopic) - ? String(object.pubSubTopic) - : undefined, - contentFilters: Array.isArray(object?.contentFilters) - ? object.contentFilters.map((e: any) => ContentFilter.fromJSON(e)) - : [], - pagingInfo: isSet(object.pagingInfo) - ? PagingInfo.fromJSON(object.pagingInfo) - : undefined, - startTime: isSet(object.startTime) ? Number(object.startTime) : undefined, - endTime: isSet(object.endTime) ? Number(object.endTime) : undefined, - }; - }, - - toJSON(message: HistoryQuery): unknown { - const obj: any = {}; - message.pubSubTopic !== undefined && - (obj.pubSubTopic = message.pubSubTopic); - if (message.contentFilters) { - obj.contentFilters = message.contentFilters.map((e) => - e ? ContentFilter.toJSON(e) : undefined - ); - } else { - obj.contentFilters = []; - } - message.pagingInfo !== undefined && - (obj.pagingInfo = message.pagingInfo - ? PagingInfo.toJSON(message.pagingInfo) - : undefined); - message.startTime !== undefined && (obj.startTime = message.startTime); - message.endTime !== undefined && (obj.endTime = message.endTime); - return obj; - }, - - fromPartial, I>>( - object: I - ): HistoryQuery { - const message = createBaseHistoryQuery(); - message.pubSubTopic = object.pubSubTopic ?? undefined; - message.contentFilters = - object.contentFilters?.map((e) => ContentFilter.fromPartial(e)) || []; - message.pagingInfo = - object.pagingInfo !== undefined && object.pagingInfo !== null - ? PagingInfo.fromPartial(object.pagingInfo) - : undefined; - message.startTime = object.startTime ?? undefined; - message.endTime = object.endTime ?? undefined; - return message; - }, -}; - -function createBaseHistoryResponse(): HistoryResponse { - return { messages: [], pagingInfo: undefined, error: 0 }; -} - -export const HistoryResponse = { - encode( - message: HistoryResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.messages) { - WakuMessage.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.pagingInfo !== undefined) { - PagingInfo.encode(message.pagingInfo, writer.uint32(26).fork()).ldelim(); - } - if (message.error !== 0) { - writer.uint32(32).int32(message.error); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): HistoryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHistoryResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.messages.push(WakuMessage.decode(reader, reader.uint32())); - break; - case 3: - message.pagingInfo = PagingInfo.decode(reader, reader.uint32()); - break; - case 4: - message.error = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HistoryResponse { - return { - messages: Array.isArray(object?.messages) - ? object.messages.map((e: any) => WakuMessage.fromJSON(e)) - : [], - pagingInfo: isSet(object.pagingInfo) - ? PagingInfo.fromJSON(object.pagingInfo) - : undefined, - error: isSet(object.error) - ? historyResponse_ErrorFromJSON(object.error) - : 0, - }; - }, - - toJSON(message: HistoryResponse): unknown { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map((e) => - e ? WakuMessage.toJSON(e) : undefined - ); - } else { - obj.messages = []; - } - message.pagingInfo !== undefined && - (obj.pagingInfo = message.pagingInfo - ? PagingInfo.toJSON(message.pagingInfo) - : undefined); - message.error !== undefined && - (obj.error = historyResponse_ErrorToJSON(message.error)); - return obj; - }, - - fromPartial, I>>( - object: I - ): HistoryResponse { - const message = createBaseHistoryResponse(); - message.messages = - object.messages?.map((e) => WakuMessage.fromPartial(e)) || []; - message.pagingInfo = - object.pagingInfo !== undefined && object.pagingInfo !== null - ? PagingInfo.fromPartial(object.pagingInfo) - : undefined; - message.error = object.error ?? 0; - return message; - }, -}; - -function createBaseHistoryRPC(): HistoryRPC { - return { requestId: "", query: undefined, response: undefined }; -} - -export const HistoryRPC = { - encode( - message: HistoryRPC, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.requestId !== "") { - writer.uint32(10).string(message.requestId); - } - if (message.query !== undefined) { - HistoryQuery.encode(message.query, writer.uint32(18).fork()).ldelim(); - } - if (message.response !== undefined) { - HistoryResponse.encode( - message.response, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): HistoryRPC { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHistoryRPC(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.requestId = reader.string(); - break; - case 2: - message.query = HistoryQuery.decode(reader, reader.uint32()); - break; - case 3: - message.response = HistoryResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HistoryRPC { - return { - requestId: isSet(object.requestId) ? String(object.requestId) : "", - query: isSet(object.query) - ? HistoryQuery.fromJSON(object.query) - : undefined, - response: isSet(object.response) - ? HistoryResponse.fromJSON(object.response) - : undefined, - }; - }, - - toJSON(message: HistoryRPC): unknown { - const obj: any = {}; - message.requestId !== undefined && (obj.requestId = message.requestId); - message.query !== undefined && - (obj.query = message.query - ? HistoryQuery.toJSON(message.query) - : undefined); - message.response !== undefined && - (obj.response = message.response - ? HistoryResponse.toJSON(message.response) - : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): HistoryRPC { - const message = createBaseHistoryRPC(); - message.requestId = object.requestId ?? ""; - message.query = - object.query !== undefined && object.query !== null - ? HistoryQuery.fromPartial(object.query) - : undefined; - message.response = - object.response !== undefined && object.response !== null - ? HistoryResponse.fromPartial(object.response) - : undefined; - return message; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (const byte of arr) { - bin.push(String.fromCharCode(byte)); - } - return btoa(bin.join("")); -} - -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto/waku/v2/store/v2beta4/store.ts b/src/proto/waku/v2/store/v2beta4/store.ts deleted file mode 100644 index 1fe800b925..0000000000 --- a/src/proto/waku/v2/store/v2beta4/store.ts +++ /dev/null @@ -1,741 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { WakuMessage } from "../../../../waku/v2/message"; - -export const protobufPackage = "waku.v2.store.v2beta4"; - -export interface Index { - digest: Uint8Array; - receivedTime: Long; - senderTime: Long; - pubsubTopic: string; -} - -export interface PagingInfo { - pageSize: Long; - cursor: Index | undefined; - direction: PagingInfo_Direction; -} - -export enum PagingInfo_Direction { - DIRECTION_BACKWARD_UNSPECIFIED = 0, - DIRECTION_FORWARD = 1, - UNRECOGNIZED = -1, -} - -export function pagingInfo_DirectionFromJSON( - object: any -): PagingInfo_Direction { - switch (object) { - case 0: - case "DIRECTION_BACKWARD_UNSPECIFIED": - return PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED; - case 1: - case "DIRECTION_FORWARD": - return PagingInfo_Direction.DIRECTION_FORWARD; - case -1: - case "UNRECOGNIZED": - default: - return PagingInfo_Direction.UNRECOGNIZED; - } -} - -export function pagingInfo_DirectionToJSON( - object: PagingInfo_Direction -): string { - switch (object) { - case PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED: - return "DIRECTION_BACKWARD_UNSPECIFIED"; - case PagingInfo_Direction.DIRECTION_FORWARD: - return "DIRECTION_FORWARD"; - default: - return "UNKNOWN"; - } -} - -export interface ContentFilter { - contentTopic: string; -} - -export interface HistoryQuery { - pubSubTopic?: string | undefined; - contentFilters: ContentFilter[]; - pagingInfo?: PagingInfo | undefined; - startTime?: Long | undefined; - endTime?: Long | undefined; -} - -export interface HistoryResponse { - messages: WakuMessage[]; - pagingInfo: PagingInfo | undefined; - error: HistoryResponse_Error; -} - -export enum HistoryResponse_Error { - ERROR_NONE_UNSPECIFIED = 0, - ERROR_INVALID_CURSOR = 1, - UNRECOGNIZED = -1, -} - -export function historyResponse_ErrorFromJSON( - object: any -): HistoryResponse_Error { - switch (object) { - case 0: - case "ERROR_NONE_UNSPECIFIED": - return HistoryResponse_Error.ERROR_NONE_UNSPECIFIED; - case 1: - case "ERROR_INVALID_CURSOR": - return HistoryResponse_Error.ERROR_INVALID_CURSOR; - case -1: - case "UNRECOGNIZED": - default: - return HistoryResponse_Error.UNRECOGNIZED; - } -} - -export function historyResponse_ErrorToJSON( - object: HistoryResponse_Error -): string { - switch (object) { - case HistoryResponse_Error.ERROR_NONE_UNSPECIFIED: - return "ERROR_NONE_UNSPECIFIED"; - case HistoryResponse_Error.ERROR_INVALID_CURSOR: - return "ERROR_INVALID_CURSOR"; - default: - return "UNKNOWN"; - } -} - -export interface HistoryRPC { - requestId: string; - query: HistoryQuery | undefined; - response: HistoryResponse | undefined; -} - -function createBaseIndex(): Index { - return { - digest: new Uint8Array(), - receivedTime: Long.ZERO, - senderTime: Long.ZERO, - pubsubTopic: "", - }; -} - -export const Index = { - encode(message: Index, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.digest.length !== 0) { - writer.uint32(10).bytes(message.digest); - } - if (!message.receivedTime.isZero()) { - writer.uint32(16).sint64(message.receivedTime); - } - if (!message.senderTime.isZero()) { - writer.uint32(24).sint64(message.senderTime); - } - if (message.pubsubTopic !== "") { - writer.uint32(34).string(message.pubsubTopic); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Index { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIndex(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.digest = reader.bytes(); - break; - case 2: - message.receivedTime = reader.sint64() as Long; - break; - case 3: - message.senderTime = reader.sint64() as Long; - break; - case 4: - message.pubsubTopic = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Index { - return { - digest: isSet(object.digest) - ? bytesFromBase64(object.digest) - : new Uint8Array(), - receivedTime: isSet(object.receivedTime) - ? Long.fromString(object.receivedTime) - : Long.ZERO, - senderTime: isSet(object.senderTime) - ? Long.fromString(object.senderTime) - : Long.ZERO, - pubsubTopic: isSet(object.pubsubTopic) ? String(object.pubsubTopic) : "", - }; - }, - - toJSON(message: Index): unknown { - const obj: any = {}; - message.digest !== undefined && - (obj.digest = base64FromBytes( - message.digest !== undefined ? message.digest : new Uint8Array() - )); - message.receivedTime !== undefined && - (obj.receivedTime = (message.receivedTime || Long.ZERO).toString()); - message.senderTime !== undefined && - (obj.senderTime = (message.senderTime || Long.ZERO).toString()); - message.pubsubTopic !== undefined && - (obj.pubsubTopic = message.pubsubTopic); - return obj; - }, - - fromPartial, I>>(object: I): Index { - const message = createBaseIndex(); - message.digest = object.digest ?? new Uint8Array(); - message.receivedTime = - object.receivedTime !== undefined && object.receivedTime !== null - ? Long.fromValue(object.receivedTime) - : Long.ZERO; - message.senderTime = - object.senderTime !== undefined && object.senderTime !== null - ? Long.fromValue(object.senderTime) - : Long.ZERO; - message.pubsubTopic = object.pubsubTopic ?? ""; - return message; - }, -}; - -function createBasePagingInfo(): PagingInfo { - return { pageSize: Long.UZERO, cursor: undefined, direction: 0 }; -} - -export const PagingInfo = { - encode( - message: PagingInfo, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (!message.pageSize.isZero()) { - writer.uint32(8).uint64(message.pageSize); - } - if (message.cursor !== undefined) { - Index.encode(message.cursor, writer.uint32(18).fork()).ldelim(); - } - if (message.direction !== 0) { - writer.uint32(24).int32(message.direction); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PagingInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePagingInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pageSize = reader.uint64() as Long; - break; - case 2: - message.cursor = Index.decode(reader, reader.uint32()); - break; - case 3: - message.direction = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PagingInfo { - return { - pageSize: isSet(object.pageSize) - ? Long.fromString(object.pageSize) - : Long.UZERO, - cursor: isSet(object.cursor) ? Index.fromJSON(object.cursor) : undefined, - direction: isSet(object.direction) - ? pagingInfo_DirectionFromJSON(object.direction) - : 0, - }; - }, - - toJSON(message: PagingInfo): unknown { - const obj: any = {}; - message.pageSize !== undefined && - (obj.pageSize = (message.pageSize || Long.UZERO).toString()); - message.cursor !== undefined && - (obj.cursor = message.cursor ? Index.toJSON(message.cursor) : undefined); - message.direction !== undefined && - (obj.direction = pagingInfo_DirectionToJSON(message.direction)); - return obj; - }, - - fromPartial, I>>( - object: I - ): PagingInfo { - const message = createBasePagingInfo(); - message.pageSize = - object.pageSize !== undefined && object.pageSize !== null - ? Long.fromValue(object.pageSize) - : Long.UZERO; - message.cursor = - object.cursor !== undefined && object.cursor !== null - ? Index.fromPartial(object.cursor) - : undefined; - message.direction = object.direction ?? 0; - return message; - }, -}; - -function createBaseContentFilter(): ContentFilter { - return { contentTopic: "" }; -} - -export const ContentFilter = { - encode( - message: ContentFilter, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.contentTopic !== "") { - writer.uint32(10).string(message.contentTopic); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ContentFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContentFilter(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contentTopic = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ContentFilter { - return { - contentTopic: isSet(object.contentTopic) - ? String(object.contentTopic) - : "", - }; - }, - - toJSON(message: ContentFilter): unknown { - const obj: any = {}; - message.contentTopic !== undefined && - (obj.contentTopic = message.contentTopic); - return obj; - }, - - fromPartial, I>>( - object: I - ): ContentFilter { - const message = createBaseContentFilter(); - message.contentTopic = object.contentTopic ?? ""; - return message; - }, -}; - -function createBaseHistoryQuery(): HistoryQuery { - return { - pubSubTopic: undefined, - contentFilters: [], - pagingInfo: undefined, - startTime: undefined, - endTime: undefined, - }; -} - -export const HistoryQuery = { - encode( - message: HistoryQuery, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.pubSubTopic !== undefined) { - writer.uint32(18).string(message.pubSubTopic); - } - for (const v of message.contentFilters) { - ContentFilter.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.pagingInfo !== undefined) { - PagingInfo.encode(message.pagingInfo, writer.uint32(34).fork()).ldelim(); - } - if (message.startTime !== undefined) { - writer.uint32(40).sint64(message.startTime); - } - if (message.endTime !== undefined) { - writer.uint32(48).sint64(message.endTime); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): HistoryQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHistoryQuery(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.pubSubTopic = reader.string(); - break; - case 3: - message.contentFilters.push( - ContentFilter.decode(reader, reader.uint32()) - ); - break; - case 4: - message.pagingInfo = PagingInfo.decode(reader, reader.uint32()); - break; - case 5: - message.startTime = reader.sint64() as Long; - break; - case 6: - message.endTime = reader.sint64() as Long; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HistoryQuery { - return { - pubSubTopic: isSet(object.pubSubTopic) - ? String(object.pubSubTopic) - : undefined, - contentFilters: Array.isArray(object?.contentFilters) - ? object.contentFilters.map((e: any) => ContentFilter.fromJSON(e)) - : [], - pagingInfo: isSet(object.pagingInfo) - ? PagingInfo.fromJSON(object.pagingInfo) - : undefined, - startTime: isSet(object.startTime) - ? Long.fromString(object.startTime) - : undefined, - endTime: isSet(object.endTime) - ? Long.fromString(object.endTime) - : undefined, - }; - }, - - toJSON(message: HistoryQuery): unknown { - const obj: any = {}; - message.pubSubTopic !== undefined && - (obj.pubSubTopic = message.pubSubTopic); - if (message.contentFilters) { - obj.contentFilters = message.contentFilters.map((e) => - e ? ContentFilter.toJSON(e) : undefined - ); - } else { - obj.contentFilters = []; - } - message.pagingInfo !== undefined && - (obj.pagingInfo = message.pagingInfo - ? PagingInfo.toJSON(message.pagingInfo) - : undefined); - message.startTime !== undefined && - (obj.startTime = (message.startTime || undefined).toString()); - message.endTime !== undefined && - (obj.endTime = (message.endTime || undefined).toString()); - return obj; - }, - - fromPartial, I>>( - object: I - ): HistoryQuery { - const message = createBaseHistoryQuery(); - message.pubSubTopic = object.pubSubTopic ?? undefined; - message.contentFilters = - object.contentFilters?.map((e) => ContentFilter.fromPartial(e)) || []; - message.pagingInfo = - object.pagingInfo !== undefined && object.pagingInfo !== null - ? PagingInfo.fromPartial(object.pagingInfo) - : undefined; - message.startTime = - object.startTime !== undefined && object.startTime !== null - ? Long.fromValue(object.startTime) - : undefined; - message.endTime = - object.endTime !== undefined && object.endTime !== null - ? Long.fromValue(object.endTime) - : undefined; - return message; - }, -}; - -function createBaseHistoryResponse(): HistoryResponse { - return { messages: [], pagingInfo: undefined, error: 0 }; -} - -export const HistoryResponse = { - encode( - message: HistoryResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.messages) { - WakuMessage.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.pagingInfo !== undefined) { - PagingInfo.encode(message.pagingInfo, writer.uint32(26).fork()).ldelim(); - } - if (message.error !== 0) { - writer.uint32(32).int32(message.error); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): HistoryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHistoryResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.messages.push(WakuMessage.decode(reader, reader.uint32())); - break; - case 3: - message.pagingInfo = PagingInfo.decode(reader, reader.uint32()); - break; - case 4: - message.error = reader.int32() as any; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HistoryResponse { - return { - messages: Array.isArray(object?.messages) - ? object.messages.map((e: any) => WakuMessage.fromJSON(e)) - : [], - pagingInfo: isSet(object.pagingInfo) - ? PagingInfo.fromJSON(object.pagingInfo) - : undefined, - error: isSet(object.error) - ? historyResponse_ErrorFromJSON(object.error) - : 0, - }; - }, - - toJSON(message: HistoryResponse): unknown { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map((e) => - e ? WakuMessage.toJSON(e) : undefined - ); - } else { - obj.messages = []; - } - message.pagingInfo !== undefined && - (obj.pagingInfo = message.pagingInfo - ? PagingInfo.toJSON(message.pagingInfo) - : undefined); - message.error !== undefined && - (obj.error = historyResponse_ErrorToJSON(message.error)); - return obj; - }, - - fromPartial, I>>( - object: I - ): HistoryResponse { - const message = createBaseHistoryResponse(); - message.messages = - object.messages?.map((e) => WakuMessage.fromPartial(e)) || []; - message.pagingInfo = - object.pagingInfo !== undefined && object.pagingInfo !== null - ? PagingInfo.fromPartial(object.pagingInfo) - : undefined; - message.error = object.error ?? 0; - return message; - }, -}; - -function createBaseHistoryRPC(): HistoryRPC { - return { requestId: "", query: undefined, response: undefined }; -} - -export const HistoryRPC = { - encode( - message: HistoryRPC, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.requestId !== "") { - writer.uint32(10).string(message.requestId); - } - if (message.query !== undefined) { - HistoryQuery.encode(message.query, writer.uint32(18).fork()).ldelim(); - } - if (message.response !== undefined) { - HistoryResponse.encode( - message.response, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): HistoryRPC { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHistoryRPC(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.requestId = reader.string(); - break; - case 2: - message.query = HistoryQuery.decode(reader, reader.uint32()); - break; - case 3: - message.response = HistoryResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): HistoryRPC { - return { - requestId: isSet(object.requestId) ? String(object.requestId) : "", - query: isSet(object.query) - ? HistoryQuery.fromJSON(object.query) - : undefined, - response: isSet(object.response) - ? HistoryResponse.fromJSON(object.response) - : undefined, - }; - }, - - toJSON(message: HistoryRPC): unknown { - const obj: any = {}; - message.requestId !== undefined && (obj.requestId = message.requestId); - message.query !== undefined && - (obj.query = message.query - ? HistoryQuery.toJSON(message.query) - : undefined); - message.response !== undefined && - (obj.response = message.response - ? HistoryResponse.toJSON(message.response) - : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): HistoryRPC { - const message = createBaseHistoryRPC(); - message.requestId = object.requestId ?? ""; - message.query = - object.query !== undefined && object.query !== null - ? HistoryQuery.fromPartial(object.query) - : undefined; - message.response = - object.response !== undefined && object.response !== null - ? HistoryResponse.fromPartial(object.response) - : undefined; - return message; - }, -}; - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var globalThis: any = (() => { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - if (typeof global !== "undefined") return global; - throw "Unable to locate global object"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (const byte of arr) { - bin.push(String.fromCharCode(byte)); - } - return btoa(bin.join("")); -} - -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/test_utils/nwaku.ts b/src/test_utils/nwaku.ts index bca896fb63..89365fe8c7 100644 --- a/src/test_utils/nwaku.ts +++ b/src/test_utils/nwaku.ts @@ -14,7 +14,7 @@ import portfinder from "portfinder"; import { DefaultPubSubTopic } from "../lib/constants"; import { hexToBytes } from "../lib/utils"; import { WakuMessage } from "../lib/waku_message"; -import * as proto from "../proto/waku/v2/message"; +import * as proto from "../proto/message"; import { existsAsync, mkdirAsync, openAsync } from "./async_fs"; import waitForLine from "./log_file"; @@ -88,7 +88,7 @@ export class Nwaku { let timestamp; if (message.proto.timestamp) { - timestamp = message.proto.timestamp.toNumber(); + timestamp = Number.parseInt(message.proto.timestamp.toString(10)); } return { From c4758a8737517c0302f90f3c4bf3a5e2f9c86e2e Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 27 May 2022 23:01:52 +1000 Subject: [PATCH 07/26] Setup rollup, move files to dist/ --- .gitignore | 1 + CHANGELOG.md | 4 + package-lock.json | 781 ++++++++++++++++++++++----------------------- package.json | 28 +- rollup.config.js | 21 ++ tsconfig.json | 4 +- tsconfig.umd.json | 9 - webpack.config.cjs | 2 +- 8 files changed, 426 insertions(+), 424 deletions(-) create mode 100644 rollup.config.js delete mode 100644 tsconfig.umd.json diff --git a/.gitignore b/.gitignore index b005ad70cf..643d204d8c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .nyc_output .angular build +dist node_modules src/**.js coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index 05b7a04817..fb5b65aa7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Published files moved from `build` to `dist/`. + ## [0.24.0] - 2022-05-27 ### Added diff --git a/package-lock.json b/package-lock.json index 8346300fe1..e062e1d57e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,9 @@ }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", "@size-limit/preset-big-lib": "^7.0.8", "@types/app-root-path": "^1.2.4", "@types/chai": "^4.2.15", @@ -78,16 +81,17 @@ "process": "^0.11.10", "protons": "^3.0.4", "puppeteer": "^13.0.1", + "rollup": "^2.75.0", + "rollup-plugin-polyfill-node": "^0.9.0", "size-limit": "^7.0.8", "stream-browserify": "^3.0.0", "tail": "^2.2.0", + "terser": "^5.13.1", "ts-loader": "^9.2.6", "ts-node": "^10.4.0", "typedoc": "^0.22.10", "typedoc-plugin-no-inherit": "^1.3.1", - "typescript": "^4.5.5", - "webpack": "^5.58.1", - "webpack-cli": "^4.9.0" + "typescript": "^4.5.5" }, "engines": { "node": ">=16" @@ -865,15 +869,6 @@ "node": ">=12" } }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz", - "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/@eslint/eslintrc": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", @@ -1195,6 +1190,108 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, + "node_modules/@rollup/plugin-commonjs": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", + "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "rollup": "^2.68.0" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/@rollup/plugin-inject": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz", + "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "estree-walker": "^2.0.1", + "magic-string": "^0.25.7" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, + "node_modules/@rollup/plugin-inject/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.0.8" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^2.42.0" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/@rollup/pluginutils/node_modules/@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, "node_modules/@sitespeed.io/tracium": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@sitespeed.io/tracium/-/tracium-0.3.3.tgz", @@ -1556,6 +1653,15 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "node_modules/@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/retry": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", @@ -2099,42 +2205,6 @@ "@xtuc/long": "4.2.2" } }, - "node_modules/@webpack-cli/configtest": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz", - "integrity": "sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg==", - "dev": true, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x", - "webpack-cli": "4.x.x" - } - }, - "node_modules/@webpack-cli/info": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.1.tgz", - "integrity": "sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA==", - "dev": true, - "dependencies": { - "envinfo": "^7.7.3" - }, - "peerDependencies": { - "webpack-cli": "4.x.x" - } - }, - "node_modules/@webpack-cli/serve": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz", - "integrity": "sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==", - "dev": true, - "peerDependencies": { - "webpack-cli": "4.x.x" - }, - "peerDependenciesMeta": { - "webpack-dev-server": { - "optional": true - } - } - }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -2792,6 +2862,18 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/bytes-iec": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", @@ -3098,20 +3180,6 @@ "node": ">=8" } }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3156,15 +3224,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/comment-json": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.1.1.tgz", @@ -3770,6 +3829,15 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/deepmerge-ts": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-4.0.3.tgz", @@ -4144,18 +4212,6 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", @@ -4824,6 +4880,12 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -4980,12 +5042,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "node_modules/fastest-levenshtein": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", - "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", - "dev": true - }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -5894,22 +5950,6 @@ "node": ">=4" } }, - "node_modules/import-local": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", - "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -6065,6 +6105,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-builtin-module": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", + "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", @@ -6155,6 +6207,12 @@ "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, "node_modules/is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -6205,24 +6263,21 @@ "node": ">=8" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -6361,15 +6416,6 @@ "node": ">=12" } }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/isomorphic-fetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", @@ -7647,6 +7693,15 @@ "multiaddr": "^10.0.0" } }, + "node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -10100,18 +10155,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -10190,6 +10233,33 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rollup": { + "version": "2.75.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.0.tgz", + "integrity": "sha512-1/wxtweHJ7YwI2AIK3ZgCBU3nbW8sLnBIFwN46cwOTnVzt8f1o6J8zPKjwoiuADvzSjmnLqJce31p0q2vQ+dqw==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-polyfill-node": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.9.0.tgz", + "integrity": "sha512-cVqm7LjgBqtZ77M9hLYayXrLz18nLIVPp3MPqNi2suStrFDg1LsA2cSdMIighr2yeuAQrphu8ymXTAsJNVABow==", + "dev": true, + "dependencies": { + "@rollup/plugin-inject": "^4.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -10316,18 +10386,6 @@ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -10519,6 +10577,12 @@ "node": ">=0.10.0" } }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, "node_modules/spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", @@ -11789,89 +11853,6 @@ } } }, - "node_modules/webpack-cli": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz", - "integrity": "sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==", - "dev": true, - "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.1.1", - "@webpack-cli/info": "^1.4.1", - "@webpack-cli/serve": "^1.6.1", - "colorette": "^2.0.14", - "commander": "^7.0.0", - "execa": "^5.0.0", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "webpack-merge": "^5.7.3" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "peerDependencies": { - "webpack": "4.x.x || 5.x.x" - }, - "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "@webpack-cli/migrate": { - "optional": true - }, - "webpack-bundle-analyzer": { - "optional": true - }, - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/webpack-cli/node_modules/colorette": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", - "dev": true - }, - "node_modules/webpack-cli/node_modules/interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/webpack-cli/node_modules/rechoir": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", - "dev": true, - "dependencies": { - "resolve": "^1.9.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/webpack-merge": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", @@ -11974,12 +11955,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "node_modules/wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", - "dev": true - }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -12920,12 +12895,6 @@ "@cspotcode/source-map-consumer": "0.8.0" } }, - "@discoveryjs/json-ext": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz", - "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==", - "dev": true - }, "@eslint/eslintrc": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", @@ -13167,6 +13136,90 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, + "@rollup/plugin-commonjs": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", + "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + }, + "dependencies": { + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + } + } + }, + "@rollup/plugin-inject": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz", + "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "estree-walker": "^2.0.1", + "magic-string": "^0.25.7" + }, + "dependencies": { + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + } + } + }, + "@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.8" + } + }, + "@rollup/plugin-node-resolve": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.19.0" + } + }, + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "dependencies": { + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + } + } + }, "@sitespeed.io/tracium": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@sitespeed.io/tracium/-/tracium-0.3.3.tgz", @@ -13501,6 +13554,15 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/retry": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", @@ -13895,29 +13957,6 @@ "@xtuc/long": "4.2.2" } }, - "@webpack-cli/configtest": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz", - "integrity": "sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg==", - "dev": true, - "requires": {} - }, - "@webpack-cli/info": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.1.tgz", - "integrity": "sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA==", - "dev": true, - "requires": { - "envinfo": "^7.7.3" - } - }, - "@webpack-cli/serve": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz", - "integrity": "sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==", - "dev": true, - "requires": {} - }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -14409,6 +14448,12 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true + }, "bytes-iec": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", @@ -14631,17 +14676,6 @@ } } }, - "clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - } - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -14677,12 +14711,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - }, "comment-json": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.1.1.tgz", @@ -15158,6 +15186,12 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, "deepmerge-ts": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-4.0.3.tgz", @@ -15458,12 +15492,6 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, - "envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true - }, "err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", @@ -15964,6 +15992,12 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -16083,12 +16117,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fastest-levenshtein": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", - "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", - "dev": true - }, "fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -16736,16 +16764,6 @@ } } }, - "import-local": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", - "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -16876,6 +16894,15 @@ "call-bind": "^1.0.2" } }, + "is-builtin-module": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", + "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "dev": true, + "requires": { + "builtin-modules": "^3.0.0" + } + }, "is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", @@ -16936,6 +16963,12 @@ "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -16965,21 +16998,21 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -17070,12 +17103,6 @@ "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-1.1.5.tgz", "integrity": "sha512-+3JqoKdBTGmyv9vOkS6b9iHhvK34UajfTibrH/1HOK8TI7K2VsM0qOCd+aJdWKtSOA8g3PqZfcwDmnR0p3klqQ==" }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, "isomorphic-fetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", @@ -18141,6 +18168,15 @@ "multiaddr": "^10.0.0" } }, + "magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -19954,15 +19990,6 @@ "path-parse": "^1.0.6" } }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - } - }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -20019,6 +20046,24 @@ "glob": "^7.1.3" } }, + "rollup": { + "version": "2.75.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.0.tgz", + "integrity": "sha512-1/wxtweHJ7YwI2AIK3ZgCBU3nbW8sLnBIFwN46cwOTnVzt8f1o6J8zPKjwoiuADvzSjmnLqJce31p0q2vQ+dqw==", + "dev": true, + "requires": { + "fsevents": "~2.3.2" + } + }, + "rollup-plugin-polyfill-node": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.9.0.tgz", + "integrity": "sha512-cVqm7LjgBqtZ77M9hLYayXrLz18nLIVPp3MPqNi2suStrFDg1LsA2cSdMIighr2yeuAQrphu8ymXTAsJNVABow==", + "dev": true, + "requires": { + "@rollup/plugin-inject": "^4.0.0" + } + }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -20115,15 +20160,6 @@ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -20273,6 +20309,12 @@ } } }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, "spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", @@ -21225,59 +21267,6 @@ } } }, - "webpack-cli": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz", - "integrity": "sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==", - "dev": true, - "requires": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.1.1", - "@webpack-cli/info": "^1.4.1", - "@webpack-cli/serve": "^1.6.1", - "colorette": "^2.0.14", - "commander": "^7.0.0", - "execa": "^5.0.0", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "webpack-merge": "^5.7.3" - }, - "dependencies": { - "colorette": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", - "dev": true - }, - "interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true - }, - "rechoir": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", - "dev": true, - "requires": { - "resolve": "^1.9.0" - } - } - } - }, - "webpack-merge": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - } - }, "webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", @@ -21350,12 +21339,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", - "dev": true - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index 912b27d95f..2ddb4174ce 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "js-waku", "version": "0.24.0", "description": "TypeScript implementation of the Waku v2 protocol", - "types": "./build/esm/index.d.ts", + "types": "./dist/esm/index.d.ts", "exports": { "node": { - "import": "./build/esm/index.js" + "import": "./dist/esm/index.js" } }, "type": "module", @@ -21,12 +21,10 @@ ], "scripts": { "prepare": "husky install", - "build": "rimraf ./build; run-p build:**", + "build": "rimraf ./dist; run-s build:**", "build:esm": "tsc", - "build:umd": "webpack --config webpack.config.cjs", - "build:umd:min": "webpack --config webpack.config.min.cjs", - "build:umd:bundle": "webpack --config webpack.config.bundle.cjs", - "build:umd:min:bundle": "webpack --config webpack.config.min.bundle.cjs", + "build:umd": "rollup --config rollup.config.js -- dist/esm/index.js", + "build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz", "size": "npm run build:esm && size-limit", "fix": "run-s fix:*", "fix:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --write", @@ -90,6 +88,9 @@ }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", "@size-limit/preset-big-lib": "^7.0.8", "@types/app-root-path": "^1.2.4", "@types/chai": "^4.2.15", @@ -132,20 +133,21 @@ "process": "^0.11.10", "protons": "^3.0.4", "puppeteer": "^13.0.1", + "rollup": "^2.75.0", + "rollup-plugin-polyfill-node": "^0.9.0", "size-limit": "^7.0.8", "stream-browserify": "^3.0.0", "tail": "^2.2.0", + "terser": "^5.13.1", "ts-loader": "^9.2.6", "ts-node": "^10.4.0", "typedoc": "^0.22.10", "typedoc-plugin-no-inherit": "^1.3.1", - "typescript": "^4.5.5", - "webpack": "^5.58.1", - "webpack-cli": "^4.9.0" + "typescript": "^4.5.5" }, "files": [ - "build/esm", - "build/umd", + "dist/esm", + "dist/umd", "src/lib/**/*.ts", "src/proto/**/*.ts", "!**/*.spec.*", @@ -162,7 +164,7 @@ }, "size-limit": [ { - "path": "build/esm/index.js", + "path": "dist/esm/index.js", "import": "{ Waku }", "config": "./webpack.config.cjs" } diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000000..cb70f33644 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,21 @@ +import { nodeResolve } from "@rollup/plugin-node-resolve"; +import commonjs from "@rollup/plugin-commonjs"; +import json from "@rollup/plugin-json"; +import nodePolyfills from "rollup-plugin-polyfill-node"; + +export default { + output: { + file: "dist/umd/index.js", + format: "umd", + name: "jswaku", + }, + plugins: [ + commonjs(), + json(), + nodePolyfills(), + nodeResolve({ + browser: true, + preferBuiltins: false, + }), + ], +}; diff --git a/tsconfig.json b/tsconfig.json index e87fb8f9e3..f0913da833 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "incremental": true, - "target": "es2015", - "outDir": "build/esm", + "target": "es2020", + "outDir": "dist/esm", "rootDir": "src", "moduleResolution": "node", "module": "es2020", diff --git a/tsconfig.umd.json b/tsconfig.umd.json deleted file mode 100644 index eb4a5cce5b..0000000000 --- a/tsconfig.umd.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "module": "UMD", - "target": "es6", - "removeComments": true, - "outFile": "build/min.js" - } -} diff --git a/webpack.config.cjs b/webpack.config.cjs index 61f4bf8614..62b1cac614 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -10,7 +10,7 @@ module.exports = { module: { rules: [ { - test: /\.ts$/, + test: /\.(js|tsx?)$/, use: "ts-loader", exclude: /(node_modules)|(node\.spec\.ts)/, }, From 9e8d4b9bb193334bcb9ff602e445fe07e68714fc Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 15 Jun 2022 19:15:28 +1000 Subject: [PATCH 08/26] Mark all proto fields as optional As expected in proto version 3. --- src/lib/waku_filter/filter_rpc.ts | 2 +- src/lib/waku_filter/index.ts | 14 ++++++--- src/lib/waku_store/index.ts | 2 +- src/proto/filter.proto | 8 ++--- src/proto/filter.ts | 16 +++++----- src/proto/light_push.proto | 10 +++--- src/proto/light_push.ts | 20 ++++++------ src/proto/store_v2beta3.proto | 20 ++++++------ src/proto/store_v2beta3.ts | 48 ++++++++++++++++------------ src/proto/store_v2beta4.proto | 22 ++++++------- src/proto/store_v2beta4.ts | 52 ++++++++++++++++++------------- 11 files changed, 118 insertions(+), 96 deletions(-) diff --git a/src/lib/waku_filter/filter_rpc.ts b/src/lib/waku_filter/filter_rpc.ts index db38b2cb7e..493501e5ad 100644 --- a/src/lib/waku_filter/filter_rpc.ts +++ b/src/lib/waku_filter/filter_rpc.ts @@ -51,7 +51,7 @@ export class FilterRPC { return this.proto.push; } - get requestId(): string { + get requestId(): string | undefined { return this.proto.requestId; } } diff --git a/src/lib/waku_filter/index.ts b/src/lib/waku_filter/index.ts index 77076be9ca..a2f12933d5 100644 --- a/src/lib/waku_filter/index.ts +++ b/src/lib/waku_filter/index.ts @@ -73,6 +73,12 @@ export class WakuFilter { true ); + const requestId = request.requestId; + if (!requestId) + throw new Error( + "Internal error: createRequest expected to set `requestId`" + ); + const peer = await this.getPeer(opts?.peerId); const stream = await this.newStream(peer); @@ -90,11 +96,11 @@ export class WakuFilter { throw e; } - this.addCallback(request.requestId, callback); + this.addCallback(requestId, callback); return async () => { - await this.unsubscribe(topic, contentFilters, request.requestId, peer); - this.removeCallback(request.requestId); + await this.unsubscribe(topic, contentFilters, requestId, peer); + this.removeCallback(requestId); }; } @@ -107,7 +113,7 @@ export class WakuFilter { async (source: AsyncIterable) => { for await (const bytes of source) { const res = FilterRPC.decode(bytes.slice()); - if (res.push?.messages?.length) { + if (res.requestId && res.push?.messages?.length) { await this.pushMessages(res.requestId, res.push.messages); } } diff --git a/src/lib/waku_store/index.ts b/src/lib/waku_store/index.ts index 36f5e15b8f..e2e462a94f 100644 --- a/src/lib/waku_store/index.ts +++ b/src/lib/waku_store/index.ts @@ -219,7 +219,7 @@ export class WakuStore { const response = reply.response as protoV2Beta4.HistoryResponse; if (response.error) { - throw "History response contains an Error" + response.error; + throw "History response contains an Error: " + response.error; } if (!response.messages || !response.messages.length) { diff --git a/src/proto/filter.proto b/src/proto/filter.proto index 369d369560..df9144023d 100644 --- a/src/proto/filter.proto +++ b/src/proto/filter.proto @@ -3,12 +3,12 @@ syntax = "proto3"; import "message.proto"; message FilterRequest { - bool subscribe = 1; - string topic = 2; + optional bool subscribe = 1; + optional string topic = 2; repeated ContentFilter content_filters = 3; message ContentFilter { - string content_topic = 1; + optional string content_topic = 1; } } @@ -17,7 +17,7 @@ message MessagePush { } message FilterRPC { - string request_id = 1; + optional string request_id = 1; optional FilterRequest request = 2; optional MessagePush push = 3; } diff --git a/src/proto/filter.ts b/src/proto/filter.ts index ea8911ac25..afd99896f2 100644 --- a/src/proto/filter.ts +++ b/src/proto/filter.ts @@ -15,20 +15,20 @@ import { import type { Codec } from "protons-runtime"; export interface FilterRequest { - subscribe: boolean; - topic: string; + subscribe?: boolean; + topic?: string; contentFilters: FilterRequest.ContentFilter[]; } export namespace FilterRequest { export interface ContentFilter { - contentTopic: string; + contentTopic?: string; } export namespace ContentFilter { export const codec = (): Codec => { return message({ - 1: { name: "contentTopic", codec: string }, + 1: { name: "contentTopic", codec: string, optional: true }, }); }; @@ -43,8 +43,8 @@ export namespace FilterRequest { export const codec = (): Codec => { return message({ - 1: { name: "subscribe", codec: bool }, - 2: { name: "topic", codec: string }, + 1: { name: "subscribe", codec: bool, optional: true }, + 2: { name: "topic", codec: string, optional: true }, 3: { name: "contentFilters", codec: FilterRequest.ContentFilter.codec(), @@ -83,7 +83,7 @@ export namespace MessagePush { } export interface FilterRPC { - requestId: string; + requestId?: string; request?: FilterRequest; push?: MessagePush; } @@ -91,7 +91,7 @@ export interface FilterRPC { export namespace FilterRPC { export const codec = (): Codec => { return message({ - 1: { name: "requestId", codec: string }, + 1: { name: "requestId", codec: string, optional: true }, 2: { name: "request", codec: FilterRequest.codec(), optional: true }, 3: { name: "push", codec: MessagePush.codec(), optional: true }, }); diff --git a/src/proto/light_push.proto b/src/proto/light_push.proto index 7d52944317..d1954b6f6b 100644 --- a/src/proto/light_push.proto +++ b/src/proto/light_push.proto @@ -3,17 +3,17 @@ syntax = "proto3"; import "message.proto"; message PushRequest { - string pub_sub_topic = 1; - WakuMessage message = 2; + optional string pub_sub_topic = 1; + optional WakuMessage message = 2; } message PushResponse { - bool is_success = 1; - string info = 2; + optional bool is_success = 1; + optional string info = 2; } message PushRPC { - string request_id = 1; + optional string request_id = 1; optional PushRequest request = 2; optional PushResponse response = 3; } diff --git a/src/proto/light_push.ts b/src/proto/light_push.ts index 2081fd2f98..6b418a3210 100644 --- a/src/proto/light_push.ts +++ b/src/proto/light_push.ts @@ -15,15 +15,15 @@ import { import type { Codec } from "protons-runtime"; export interface PushRequest { - pubSubTopic: string; - message: WakuMessage; + pubSubTopic?: string; + message?: WakuMessage; } export namespace PushRequest { export const codec = (): Codec => { return message({ - 1: { name: "pubSubTopic", codec: string }, - 2: { name: "message", codec: WakuMessage.codec() }, + 1: { name: "pubSubTopic", codec: string, optional: true }, + 2: { name: "message", codec: WakuMessage.codec(), optional: true }, }); }; @@ -37,15 +37,15 @@ export namespace PushRequest { } export interface PushResponse { - isSuccess: boolean; - info: string; + isSuccess?: boolean; + info?: string; } export namespace PushResponse { export const codec = (): Codec => { return message({ - 1: { name: "isSuccess", codec: bool }, - 2: { name: "info", codec: string }, + 1: { name: "isSuccess", codec: bool, optional: true }, + 2: { name: "info", codec: string, optional: true }, }); }; @@ -59,7 +59,7 @@ export namespace PushResponse { } export interface PushRPC { - requestId: string; + requestId?: string; request?: PushRequest; response?: PushResponse; } @@ -67,7 +67,7 @@ export interface PushRPC { export namespace PushRPC { export const codec = (): Codec => { return message({ - 1: { name: "requestId", codec: string }, + 1: { name: "requestId", codec: string, optional: true }, 2: { name: "request", codec: PushRequest.codec(), optional: true }, 3: { name: "response", codec: PushResponse.codec(), optional: true }, }); diff --git a/src/proto/store_v2beta3.proto b/src/proto/store_v2beta3.proto index 2ac4139754..8bd89ed1a2 100644 --- a/src/proto/store_v2beta3.proto +++ b/src/proto/store_v2beta3.proto @@ -3,23 +3,23 @@ syntax = "proto3"; import "message.proto"; message Index { - bytes digest = 1; - double received_time = 2; - double sender_time = 3; + optional bytes digest = 1; + optional double received_time = 2; + optional double sender_time = 3; } message PagingInfo { - uint64 page_size = 1; - Index cursor = 2; + optional uint64 page_size = 1; + optional Index cursor = 2; enum Direction { DIRECTION_BACKWARD_UNSPECIFIED = 0; DIRECTION_FORWARD = 1; } - Direction direction = 3; + optional Direction direction = 3; } message ContentFilter { - string content_topic = 1; + optional string content_topic = 1; } message HistoryQuery { @@ -32,16 +32,16 @@ message HistoryQuery { message HistoryResponse { repeated WakuMessage messages = 2; - PagingInfo paging_info = 3; + optional PagingInfo paging_info = 3; enum Error { ERROR_NONE_UNSPECIFIED = 0; ERROR_INVALID_CURSOR = 1; } - Error error = 4; + optional Error error = 4; } message HistoryRPC { - string request_id = 1; + optional string request_id = 1; optional HistoryQuery query = 2; optional HistoryResponse response = 3; } diff --git a/src/proto/store_v2beta3.ts b/src/proto/store_v2beta3.ts index f92bde640a..800de7f5c3 100644 --- a/src/proto/store_v2beta3.ts +++ b/src/proto/store_v2beta3.ts @@ -16,17 +16,17 @@ import { import type { Codec } from "protons-runtime"; export interface Index { - digest: Uint8Array; - receivedTime: number; - senderTime: number; + digest?: Uint8Array; + receivedTime?: number; + senderTime?: number; } export namespace Index { export const codec = (): Codec => { return message({ - 1: { name: "digest", codec: bytes }, - 2: { name: "receivedTime", codec: double }, - 3: { name: "senderTime", codec: double }, + 1: { name: "digest", codec: bytes, optional: true }, + 2: { name: "receivedTime", codec: double, optional: true }, + 3: { name: "senderTime", codec: double, optional: true }, }); }; @@ -40,9 +40,9 @@ export namespace Index { } export interface PagingInfo { - pageSize: bigint; - cursor: Index; - direction: PagingInfo.Direction; + pageSize?: bigint; + cursor?: Index; + direction?: PagingInfo.Direction; } export namespace PagingInfo { @@ -64,9 +64,13 @@ export namespace PagingInfo { export const codec = (): Codec => { return message({ - 1: { name: "pageSize", codec: uint64 }, - 2: { name: "cursor", codec: Index.codec() }, - 3: { name: "direction", codec: PagingInfo.Direction.codec() }, + 1: { name: "pageSize", codec: uint64, optional: true }, + 2: { name: "cursor", codec: Index.codec(), optional: true }, + 3: { + name: "direction", + codec: PagingInfo.Direction.codec(), + optional: true, + }, }); }; @@ -80,13 +84,13 @@ export namespace PagingInfo { } export interface ContentFilter { - contentTopic: string; + contentTopic?: string; } export namespace ContentFilter { export const codec = (): Codec => { return message({ - 1: { name: "contentTopic", codec: string }, + 1: { name: "contentTopic", codec: string, optional: true }, }); }; @@ -133,8 +137,8 @@ export namespace HistoryQuery { export interface HistoryResponse { messages: WakuMessage[]; - pagingInfo: PagingInfo; - error: HistoryResponse.Error; + pagingInfo?: PagingInfo; + error?: HistoryResponse.Error; } export namespace HistoryResponse { @@ -157,8 +161,12 @@ export namespace HistoryResponse { export const codec = (): Codec => { return message({ 2: { name: "messages", codec: WakuMessage.codec(), repeats: true }, - 3: { name: "pagingInfo", codec: PagingInfo.codec() }, - 4: { name: "error", codec: HistoryResponse.Error.codec() }, + 3: { name: "pagingInfo", codec: PagingInfo.codec(), optional: true }, + 4: { + name: "error", + codec: HistoryResponse.Error.codec(), + optional: true, + }, }); }; @@ -172,7 +180,7 @@ export namespace HistoryResponse { } export interface HistoryRPC { - requestId: string; + requestId?: string; query?: HistoryQuery; response?: HistoryResponse; } @@ -180,7 +188,7 @@ export interface HistoryRPC { export namespace HistoryRPC { export const codec = (): Codec => { return message({ - 1: { name: "requestId", codec: string }, + 1: { name: "requestId", codec: string, optional: true }, 2: { name: "query", codec: HistoryQuery.codec(), optional: true }, 3: { name: "response", codec: HistoryResponse.codec(), optional: true }, }); diff --git a/src/proto/store_v2beta4.proto b/src/proto/store_v2beta4.proto index 3166dc588b..337c21200d 100644 --- a/src/proto/store_v2beta4.proto +++ b/src/proto/store_v2beta4.proto @@ -3,24 +3,24 @@ syntax = "proto3"; import "message.proto"; message Index { - bytes digest = 1; - sint64 received_time = 2; - sint64 sender_time = 3; - string pubsub_topic = 4; + optional bytes digest = 1; + optional sint64 received_time = 2; + optional sint64 sender_time = 3; + optional string pubsub_topic = 4; } message PagingInfo { - uint64 page_size = 1; - Index cursor = 2; + optional uint64 page_size = 1; + optional Index cursor = 2; enum Direction { DIRECTION_BACKWARD_UNSPECIFIED = 0; DIRECTION_FORWARD = 1; } - Direction direction = 3; + optional Direction direction = 3; } message ContentFilter { - string content_topic = 1; + optional string content_topic = 1; } message HistoryQuery { @@ -33,16 +33,16 @@ message HistoryQuery { message HistoryResponse { repeated WakuMessage messages = 2; - PagingInfo paging_info = 3; + optional PagingInfo paging_info = 3; enum Error { ERROR_NONE_UNSPECIFIED = 0; ERROR_INVALID_CURSOR = 1; } - Error error = 4; + optional Error error = 4; } message HistoryRPC { - string request_id = 1; + optional string request_id = 1; optional HistoryQuery query = 2; optional HistoryResponse response = 3; } diff --git a/src/proto/store_v2beta4.ts b/src/proto/store_v2beta4.ts index 7a5adedd22..256da55a43 100644 --- a/src/proto/store_v2beta4.ts +++ b/src/proto/store_v2beta4.ts @@ -16,19 +16,19 @@ import { import type { Codec } from "protons-runtime"; export interface Index { - digest: Uint8Array; - receivedTime: bigint; - senderTime: bigint; - pubsubTopic: string; + digest?: Uint8Array; + receivedTime?: bigint; + senderTime?: bigint; + pubsubTopic?: string; } export namespace Index { export const codec = (): Codec => { return message({ - 1: { name: "digest", codec: bytes }, - 2: { name: "receivedTime", codec: sint64 }, - 3: { name: "senderTime", codec: sint64 }, - 4: { name: "pubsubTopic", codec: string }, + 1: { name: "digest", codec: bytes, optional: true }, + 2: { name: "receivedTime", codec: sint64, optional: true }, + 3: { name: "senderTime", codec: sint64, optional: true }, + 4: { name: "pubsubTopic", codec: string, optional: true }, }); }; @@ -42,9 +42,9 @@ export namespace Index { } export interface PagingInfo { - pageSize: bigint; - cursor: Index; - direction: PagingInfo.Direction; + pageSize?: bigint; + cursor?: Index; + direction?: PagingInfo.Direction; } export namespace PagingInfo { @@ -66,9 +66,13 @@ export namespace PagingInfo { export const codec = (): Codec => { return message({ - 1: { name: "pageSize", codec: uint64 }, - 2: { name: "cursor", codec: Index.codec() }, - 3: { name: "direction", codec: PagingInfo.Direction.codec() }, + 1: { name: "pageSize", codec: uint64, optional: true }, + 2: { name: "cursor", codec: Index.codec(), optional: true }, + 3: { + name: "direction", + codec: PagingInfo.Direction.codec(), + optional: true, + }, }); }; @@ -82,13 +86,13 @@ export namespace PagingInfo { } export interface ContentFilter { - contentTopic: string; + contentTopic?: string; } export namespace ContentFilter { export const codec = (): Codec => { return message({ - 1: { name: "contentTopic", codec: string }, + 1: { name: "contentTopic", codec: string, optional: true }, }); }; @@ -135,8 +139,8 @@ export namespace HistoryQuery { export interface HistoryResponse { messages: WakuMessage[]; - pagingInfo: PagingInfo; - error: HistoryResponse.Error; + pagingInfo?: PagingInfo; + error?: HistoryResponse.Error; } export namespace HistoryResponse { @@ -159,8 +163,12 @@ export namespace HistoryResponse { export const codec = (): Codec => { return message({ 2: { name: "messages", codec: WakuMessage.codec(), repeats: true }, - 3: { name: "pagingInfo", codec: PagingInfo.codec() }, - 4: { name: "error", codec: HistoryResponse.Error.codec() }, + 3: { name: "pagingInfo", codec: PagingInfo.codec(), optional: true }, + 4: { + name: "error", + codec: HistoryResponse.Error.codec(), + optional: true, + }, }); }; @@ -174,7 +182,7 @@ export namespace HistoryResponse { } export interface HistoryRPC { - requestId: string; + requestId?: string; query?: HistoryQuery; response?: HistoryResponse; } @@ -182,7 +190,7 @@ export interface HistoryRPC { export namespace HistoryRPC { export const codec = (): Codec => { return message({ - 1: { name: "requestId", codec: string }, + 1: { name: "requestId", codec: string, optional: true }, 2: { name: "query", codec: HistoryQuery.codec(), optional: true }, 3: { name: "response", codec: HistoryResponse.codec(), optional: true }, }); From ce24c2f530b3c21e546e5a7928e9c8c13fd38adf Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 15 Jun 2022 19:24:27 +1000 Subject: [PATCH 09/26] Do not fail when receiving unspecified error --- src/lib/waku_store/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/waku_store/index.ts b/src/lib/waku_store/index.ts index e2e462a94f..35e1e4da35 100644 --- a/src/lib/waku_store/index.ts +++ b/src/lib/waku_store/index.ts @@ -7,6 +7,7 @@ import { Peer } from "libp2p/src/peer-store"; import PeerId from "peer-id"; import * as protoV2Beta4 from "../../proto/store_v2beta4"; +import { HistoryResponse } from "../../proto/store_v2beta4"; import { DefaultPubSubTopic, StoreCodecs } from "../constants"; import { getPeersForProtocol, selectRandomPeer } from "../select_peer"; import { hexToBytes } from "../utils"; @@ -14,6 +15,8 @@ import { DecryptionMethod, WakuMessage } from "../waku_message"; import { HistoryRPC, PageDirection } from "./history_rpc"; +import Error = HistoryResponse.Error; + const dbg = debug("waku:store"); export const DefaultPageSize = 10; @@ -218,7 +221,8 @@ export class WakuStore { const response = reply.response as protoV2Beta4.HistoryResponse; - if (response.error) { + console.log("Response", response); + if (response.error && response.error !== Error.ERROR_NONE_UNSPECIFIED) { throw "History response contains an Error: " + response.error; } From aaa0cef315524be87217d3129a760d21a5fc7a5d Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 15 Jun 2022 16:41:51 +1000 Subject: [PATCH 10/26] Remove dupe job --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79c73ab416..838946a134 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,11 +76,6 @@ jobs: - name: build run: npm run build - - name: Check no proto files changed - shell: bash - run: | - [ $(git status --short --ignore-submodules|wc -l) -eq 0 ] - - name: test env: DEBUG: "waku:nim-waku*,waku:test*" From ca11dbf90caaca248cd661254742e3afdf147b8d Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 30 May 2022 15:25:00 +1000 Subject: [PATCH 11/26] Format proto code after generation --- .github/workflows/ci.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 838946a134..73d3310767 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,18 +42,6 @@ jobs: cd nim-waku/build ./wakunode2 --help - - name: Install bufbuild - uses: mathematic-inc/setup-buf@v2beta - with: - buf-version: ${{ env.BUF_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: "3.x" - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Cache npm cache uses: actions/cache@v2 with: @@ -64,7 +52,9 @@ jobs: uses: bahmutov/npm-install@v1 - name: Generate protobuf code - run: npm run proto + run: | + npm run proto + npm run fix - name: Check all protobuf code was committed shell: bash From 43e9de6fe202b52aada46b32616f820d2b4dc938 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 15 Jun 2022 21:17:46 +1000 Subject: [PATCH 12/26] cleanup: Migrate from ts-proto to protons --- CHANGELOG.md | 2 ++ CONTRIBUTING.md | 2 -- src/lib/waku_message/index.ts | 5 +++-- src/lib/waku_store/index.ts | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb5b65aa7e..b7d52d07c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Published files moved from `build` to `dist/`. +- Migrate from ts-proto to protons; + the latter does not bring Buffer/Long deps, is ESM compatible and remove the need for bufbuild and protoc. ## [0.24.0] - 2022-05-27 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 94b32c50b4..189ba7e06f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,8 +20,6 @@ To help ensure your PR passes, just run before committing: To build and test this repository, you need: - [Node.js & npm](https://nodejs.org/en/). - - [bufbuild](https://github.com/bufbuild/buf) (only if changing protobuf files). - - [protoc](https://grpc.io/docs/protoc-installation/) (only if changing protobuf files). - Chrome (for browser testing). - g++ & make (to build nim-waku) diff --git a/src/lib/waku_message/index.ts b/src/lib/waku_message/index.ts index 2368fc5960..804e395353 100644 --- a/src/lib/waku_message/index.ts +++ b/src/lib/waku_message/index.ts @@ -7,6 +7,7 @@ import * as version_1 from "./version_1"; const DefaultVersion = 0; const dbg = debug("waku:message"); +const OneMillion = BigInt(1_000_000); export enum DecryptionMethod { Asymmetric = "asymmetric", @@ -103,7 +104,7 @@ export class WakuMessage { payload: _payload, timestampDeprecated: timestamp.valueOf() / 1000, // milliseconds 10^-3 to nanoseconds 10^-9 - timestamp: BigInt(timestamp.valueOf()) * BigInt(1_000_000), + timestamp: BigInt(timestamp.valueOf()) * OneMillion, version, contentTopic, }, @@ -283,7 +284,7 @@ export class WakuMessage { try { if (this.proto.timestamp) { // nanoseconds 10^-9 to milliseconds 10^-3 - const timestamp = this.proto.timestamp / BigInt(1_000_000); + const timestamp = this.proto.timestamp / OneMillion; return new Date(Number(timestamp)); } diff --git a/src/lib/waku_store/index.ts b/src/lib/waku_store/index.ts index 35e1e4da35..3cad6bb492 100644 --- a/src/lib/waku_store/index.ts +++ b/src/lib/waku_store/index.ts @@ -221,7 +221,6 @@ export class WakuStore { const response = reply.response as protoV2Beta4.HistoryResponse; - console.log("Response", response); if (response.error && response.error !== Error.ERROR_NONE_UNSPECIFIED) { throw "History response contains an Error: " + response.error; } From 792c84ec31dc29f9c06526c1173b1f7cdca0f4aa Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 15 Jun 2022 21:39:01 +1000 Subject: [PATCH 13/26] Fix exports field --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ddb4174ce..4b7ab8df07 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "TypeScript implementation of the Waku v2 protocol", "types": "./dist/esm/index.d.ts", "exports": { - "node": { + ".": { "import": "./dist/esm/index.js" } }, From 43580dd0936270b5e97cf83dda7f24139b7cded8 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 10:17:37 +1000 Subject: [PATCH 14/26] Add types export --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 4b7ab8df07..a14dcbc1af 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "types": "./dist/esm/index.d.ts", "exports": { ".": { + "types": "./dist/esm/index.d.ts", "import": "./dist/esm/index.js" } }, From 58006e1e38b9c49ff3aff9803daae3cd3d7a6ded Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 10:31:02 +1000 Subject: [PATCH 15/26] Include root source files --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index a14dcbc1af..789e4ecbdf 100644 --- a/package.json +++ b/package.json @@ -149,6 +149,7 @@ "files": [ "dist/esm", "dist/umd", + "src/*.ts", "src/lib/**/*.ts", "src/proto/**/*.ts", "!**/*.spec.*", From 7ea98c1af06b236a639d636da158b02bdbbf14b5 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 14:36:08 +1000 Subject: [PATCH 16/26] Script to add js extension to esm files --- build-scripts/fix-imports.js | 61 ++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 build-scripts/fix-imports.js diff --git a/build-scripts/fix-imports.js b/build-scripts/fix-imports.js new file mode 100644 index 0000000000..dd36bc1246 --- /dev/null +++ b/build-scripts/fix-imports.js @@ -0,0 +1,61 @@ +import path from "path"; +import fs from "fs"; + +const START_PATH = path.join(process.cwd(), "dist/esm"); +const IMPORT_REGEXP = + /^((import|export) [^';]* from "(@[^";]+\/)?([^@";]*\/[^";]*)[^";]*)"/g; +const JUST_ADD_AN_EXTENSION = '$1.js"'; +const ADD_INDEX_FILE = '$1/index.js"'; +const JS_EXT = ".js"; + +function fixImportsAtFolder(rootPath) { + const entries = fs.readdirSync(rootPath); + + entries.forEach((entry) => { + const entryPath = path.join(rootPath, entry); + if (entry.endsWith(JS_EXT)) { + fixImportsAtFile(entryPath); + } else { + const extName = path.extname(entry); + if (!extName) { + const stat = fs.statSync(entryPath); + if (stat.isDirectory()) { + fixImportsAtFolder(entryPath); + } + } + } + }); +} + +function fixImportsAtFile(filePath) { + const content = fs.readFileSync(filePath).toString("utf8"); + const lines = content.split("\n"); + const fixedLines = lines.map((l) => { + if (!l.match(IMPORT_REGEXP)) { + return l; + } + + const [_, importPath] = l.split(`"`); + const fullPath = path.join(filePath, "..", importPath); + const exists = fs.existsSync(fullPath); + if (exists === false) { + console.log("Update ", l); + return l.replace(IMPORT_REGEXP, JUST_ADD_AN_EXTENSION); + } + + const stat = fs.statSync(fullPath); + const isDirectory = stat.isDirectory(); + if (isDirectory === true) { + console.log("Update ", l); + return l.replace(IMPORT_REGEXP, ADD_INDEX_FILE); + } + + return l; + }); + const withFixedImports = fixedLines.join("\n"); + fs.writeFileSync(filePath, withFixedImports); +} + +fixImportsAtFolder(START_PATH); +console.log("imports fixed..."); +console.log("================"); diff --git a/package.json b/package.json index 789e4ecbdf..da6ed0d884 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "scripts": { "prepare": "husky install", "build": "rimraf ./dist; run-s build:**", - "build:esm": "tsc", + "build:esm": "tsc && node build-scripts/fix-imports.js", "build:umd": "rollup --config rollup.config.js -- dist/esm/index.js", "build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz", "size": "npm run build:esm && size-limit", From 5ca3957b39ff791b7c02d5c5e685a49ec7e8f62e Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 14:56:37 +1000 Subject: [PATCH 17/26] fix: options can be undefined --- src/lib/waku_relay/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/waku_relay/index.ts b/src/lib/waku_relay/index.ts index 1c52277cf5..1011088903 100644 --- a/src/lib/waku_relay/index.ts +++ b/src/lib/waku_relay/index.ts @@ -78,7 +78,7 @@ export class WakuRelay extends Gossipsub { ) { super( libp2p, - Object.assign(options, { + Object.assign(options ?? {}, { // Ensure that no signature is included nor expected in the messages. globalSignaturePolicy: SignaturePolicy.StrictNoSign, }) From 53a3f7fcbf995c507da23c3802f810ae3b71b8b8 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 15:08:19 +1000 Subject: [PATCH 18/26] Apply import update logic for external modules --- build-scripts/fix-imports.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build-scripts/fix-imports.js b/build-scripts/fix-imports.js index dd36bc1246..8eaee14d6c 100644 --- a/build-scripts/fix-imports.js +++ b/build-scripts/fix-imports.js @@ -36,8 +36,16 @@ function fixImportsAtFile(filePath) { } const [_, importPath] = l.split(`"`); - const fullPath = path.join(filePath, "..", importPath); - const exists = fs.existsSync(fullPath); + let exists = true; + let fullPath; + if (importPath.startsWith(".")) { + fullPath = path.join(filePath, "..", importPath); + exists = fs.existsSync(fullPath); + } else { + fullPath = path.join(process.cwd(), "node_modules", importPath); + exists = fs.existsSync(fullPath); + } + if (exists === false) { console.log("Update ", l); return l.replace(IMPORT_REGEXP, JUST_ADD_AN_EXTENSION); From ebbb0a27136a476d0aa9bf3113cb94c2356e166c Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 15:55:04 +1000 Subject: [PATCH 19/26] Re-introduce cjs build --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index da6ed0d884..d2f63788b5 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "exports": { ".": { "types": "./dist/esm/index.d.ts", - "import": "./dist/esm/index.js" + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" } }, "type": "module", @@ -23,6 +24,7 @@ "scripts": { "prepare": "husky install", "build": "rimraf ./dist; run-s build:**", + "build:cjs": "tsc --module commonjs --outDir dist/cjs", "build:esm": "tsc && node build-scripts/fix-imports.js", "build:umd": "rollup --config rollup.config.js -- dist/esm/index.js", "build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz", @@ -148,6 +150,7 @@ }, "files": [ "dist/esm", + "dist/cjs", "dist/umd", "src/*.ts", "src/lib/**/*.ts", From e3b6292a6eaba0b3f86607b0683c9d1d7957ea4b Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 16:36:48 +1000 Subject: [PATCH 20/26] Use rollup instead of tsc to generate cjs files --- package.json | 4 ++-- rollup.cjs.config.js | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 rollup.cjs.config.js diff --git a/package.json b/package.json index d2f63788b5..490617509c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ ".": { "types": "./dist/esm/index.d.ts", "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js" + "require": "./dist/cjs/index.cjs" } }, "type": "module", @@ -24,8 +24,8 @@ "scripts": { "prepare": "husky install", "build": "rimraf ./dist; run-s build:**", - "build:cjs": "tsc --module commonjs --outDir dist/cjs", "build:esm": "tsc && node build-scripts/fix-imports.js", + "build:cjs": "rollup --config rollup.cjs.config.js -- dist/esm/index.js", "build:umd": "rollup --config rollup.config.js -- dist/esm/index.js", "build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz", "size": "npm run build:esm && size-limit", diff --git a/rollup.cjs.config.js b/rollup.cjs.config.js new file mode 100644 index 0000000000..cb6ad03637 --- /dev/null +++ b/rollup.cjs.config.js @@ -0,0 +1,20 @@ +import { nodeResolve } from "@rollup/plugin-node-resolve"; +import commonjs from "@rollup/plugin-commonjs"; +import json from "@rollup/plugin-json"; +import nodePolyfills from "rollup-plugin-polyfill-node"; + +export default { + output: { + file: "dist/cjs/index.cjs", + format: "cjs", + }, + plugins: [ + commonjs(), + json(), + nodePolyfills(), + nodeResolve({ + browser: true, + preferBuiltins: false, + }), + ], +}; From 7432aaca2572d46a37915ec54df9184e02a52137 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 16:37:05 +1000 Subject: [PATCH 21/26] Add `main` and `module` properties --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 490617509c..7e811504bc 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,8 @@ "version": "0.24.0", "description": "TypeScript implementation of the Waku v2 protocol", "types": "./dist/esm/index.d.ts", + "main": "./dist/cjs/index.cjs", + "module": "./dist/esm/index.js", "exports": { ".": { "types": "./dist/esm/index.d.ts", From b32246fa0a2552f7584072fb095119245ff0e577 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 17:03:49 +1000 Subject: [PATCH 22/26] Change exported name to `waku` for UMD and CJS --- rollup.cjs.config.js | 1 + rollup.config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rollup.cjs.config.js b/rollup.cjs.config.js index cb6ad03637..7c8f189ab3 100644 --- a/rollup.cjs.config.js +++ b/rollup.cjs.config.js @@ -7,6 +7,7 @@ export default { output: { file: "dist/cjs/index.cjs", format: "cjs", + name: "waku", }, plugins: [ commonjs(), diff --git a/rollup.config.js b/rollup.config.js index cb70f33644..90f804398f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,7 +7,7 @@ export default { output: { file: "dist/umd/index.js", format: "umd", - name: "jswaku", + name: "waku", }, plugins: [ commonjs(), From 3dde86fcb7a84708487aa2bd4765d9ed0f70de21 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 17:18:24 +1000 Subject: [PATCH 23/26] Revert to webpack for UMD --- package-lock.json | 406 +++++++++++++++++- package.json | 5 +- webpack.config.bundle.cjs | 40 -- webpack.config.cjs | 50 --- webpack.config.min.cjs | 46 -- ...g.min.bundle.cjs => webpack.umd.config.cjs | 6 +- 6 files changed, 411 insertions(+), 142 deletions(-) delete mode 100644 webpack.config.bundle.cjs delete mode 100644 webpack.config.cjs delete mode 100644 webpack.config.min.cjs rename webpack.config.min.bundle.cjs => webpack.umd.config.cjs (86%) diff --git a/package-lock.json b/package-lock.json index e062e1d57e..444271c0f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,7 +91,8 @@ "ts-node": "^10.4.0", "typedoc": "^0.22.10", "typedoc-plugin-no-inherit": "^1.3.1", - "typescript": "^4.5.5" + "typescript": "^4.5.5", + "webpack-cli": "^4.10.0" }, "engines": { "node": ">=16" @@ -869,6 +870,15 @@ "node": ">=12" } }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", @@ -2205,6 +2215,42 @@ "@xtuc/long": "4.2.2" } }, + "node_modules/@webpack-cli/configtest": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", + "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", + "dev": true, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x", + "webpack-cli": "4.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", + "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", + "dev": true, + "dependencies": { + "envinfo": "^7.7.3" + }, + "peerDependencies": { + "webpack-cli": "4.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", + "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", + "dev": true, + "peerDependencies": { + "webpack-cli": "4.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -3180,6 +3226,20 @@ "node": ">=8" } }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3224,6 +3284,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/comment-json": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.1.1.tgz", @@ -4212,6 +4281,18 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", @@ -5042,6 +5123,12 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "node_modules/fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -5950,6 +6037,25 @@ "node": ">=4" } }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -6017,6 +6123,15 @@ "node": ">= 0.4" } }, + "node_modules/interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/ip-address": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-8.1.0.tgz", @@ -6263,6 +6378,18 @@ "node": ">=8" } }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -6416,6 +6543,15 @@ "node": ">=12" } }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/isomorphic-fetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", @@ -10020,6 +10156,18 @@ "ms": "^2.1.1" } }, + "node_modules/rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "dev": true, + "dependencies": { + "resolve": "^1.9.0" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/redent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", @@ -10155,6 +10303,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -10386,6 +10546,18 @@ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -11853,6 +12025,72 @@ } } }, + "node_modules/webpack-cli": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", + "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.2.0", + "@webpack-cli/info": "^1.5.0", + "@webpack-cli/serve": "^1.7.0", + "colorette": "^2.0.14", + "commander": "^7.0.0", + "cross-spawn": "^7.0.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "@webpack-cli/migrate": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + }, + "node_modules/webpack-merge": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", @@ -11955,6 +12193,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "node_modules/wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -12895,6 +13139,12 @@ "@cspotcode/source-map-consumer": "0.8.0" } }, + "@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true + }, "@eslint/eslintrc": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", @@ -13957,6 +14207,29 @@ "@xtuc/long": "4.2.2" } }, + "@webpack-cli/configtest": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", + "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", + "dev": true, + "requires": {} + }, + "@webpack-cli/info": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", + "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", + "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", + "dev": true, + "requires": {} + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -14676,6 +14949,17 @@ } } }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -14711,6 +14995,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + }, "comment-json": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.1.1.tgz", @@ -15492,6 +15782,12 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, + "envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true + }, "err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", @@ -16117,6 +16413,12 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, "fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -16764,6 +17066,16 @@ } } }, + "import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -16822,6 +17134,12 @@ "side-channel": "^1.0.4" } }, + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true + }, "ip-address": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-8.1.0.tgz", @@ -16998,6 +17316,15 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, "is-potential-custom-element-name": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", @@ -17103,6 +17430,12 @@ "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-1.1.5.tgz", "integrity": "sha512-+3JqoKdBTGmyv9vOkS6b9iHhvK34UajfTibrH/1HOK8TI7K2VsM0qOCd+aJdWKtSOA8g3PqZfcwDmnR0p3klqQ==" }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true + }, "isomorphic-fetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", @@ -19889,6 +20222,15 @@ "ms": "^2.1.1" } }, + "rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, "redent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", @@ -19990,6 +20332,15 @@ "path-parse": "^1.0.6" } }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -20160,6 +20511,15 @@ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -21267,6 +21627,44 @@ } } }, + "webpack-cli": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", + "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", + "dev": true, + "requires": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.2.0", + "@webpack-cli/info": "^1.5.0", + "@webpack-cli/serve": "^1.7.0", + "colorette": "^2.0.14", + "commander": "^7.0.0", + "cross-spawn": "^7.0.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "webpack-merge": "^5.7.3" + }, + "dependencies": { + "colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + } + } + }, + "webpack-merge": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + } + }, "webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", @@ -21339,6 +21737,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index 7e811504bc..7952c4d5c9 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "build": "rimraf ./dist; run-s build:**", "build:esm": "tsc && node build-scripts/fix-imports.js", "build:cjs": "rollup --config rollup.cjs.config.js -- dist/esm/index.js", - "build:umd": "rollup --config rollup.config.js -- dist/esm/index.js", + "build:umd": "webpack --config webpack.umd.config.cjs", "build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz", "size": "npm run build:esm && size-limit", "fix": "run-s fix:*", @@ -148,7 +148,8 @@ "ts-node": "^10.4.0", "typedoc": "^0.22.10", "typedoc-plugin-no-inherit": "^1.3.1", - "typescript": "^4.5.5" + "typescript": "^4.5.5", + "webpack-cli": "^4.10.0" }, "files": [ "dist/esm", diff --git a/webpack.config.bundle.cjs b/webpack.config.bundle.cjs deleted file mode 100644 index 56f701e1e3..0000000000 --- a/webpack.config.bundle.cjs +++ /dev/null @@ -1,40 +0,0 @@ -const webpack = require("webpack"); -const path = require("path"); - -module.exports = { - mode: "development", - entry: { - "js-waku": "./src/index.ts", - }, - devtool: "inline-source-map", - module: { - rules: [ - { - test: /\.ts$/, - use: "ts-loader", - exclude: /node_modules/, - }, - ], - }, - plugins: [ - new webpack.ProvidePlugin({ - process: "process/browser.js", - Buffer: ["buffer", "Buffer"], - }), - ], - resolve: { - extensions: [".ts", ".js"], - fallback: { - buffer: require.resolve("buffer/"), - crypto: false, - stream: require.resolve("stream-browserify"), - }, - }, - output: { - filename: "[name].bundle.js", - path: path.resolve(__dirname, "build/umd"), - library: "jswaku", - libraryTarget: "umd", - globalObject: "this", - }, -}; diff --git a/webpack.config.cjs b/webpack.config.cjs deleted file mode 100644 index 62b1cac614..0000000000 --- a/webpack.config.cjs +++ /dev/null @@ -1,50 +0,0 @@ -const webpack = require("webpack"); -const path = require("path"); - -module.exports = { - mode: "development", - entry: { - "js-waku": "./src/index.ts", - }, - devtool: "inline-source-map", - module: { - rules: [ - { - test: /\.(js|tsx?)$/, - use: "ts-loader", - exclude: /(node_modules)|(node\.spec\.ts)/, - }, - { - test: /node\.spec\.ts$/, - use: "ignore-loader", - }, - ], - }, - plugins: [ - new webpack.ProvidePlugin({ - process: "process/browser.js", - Buffer: ["buffer", "Buffer"], - }), - ], - resolve: { - extensions: [".ts", ".js"], - fallback: { - buffer: require.resolve("buffer/"), - crypto: false, - stream: require.resolve("stream-browserify"), - }, - }, - output: { - filename: "[name].js", - path: path.resolve(__dirname, "build/umd"), - library: "jswaku", - libraryTarget: "umd", - globalObject: "this", - }, - optimization: { - splitChunks: { - name: "vendors", - chunks: "all", - }, - }, -}; diff --git a/webpack.config.min.cjs b/webpack.config.min.cjs deleted file mode 100644 index fe707bbbec..0000000000 --- a/webpack.config.min.cjs +++ /dev/null @@ -1,46 +0,0 @@ -const webpack = require("webpack"); -const path = require("path"); - -module.exports = { - mode: "production", - entry: { - "js-waku": "./src/index.ts", - }, - devtool: "inline-source-map", - module: { - rules: [ - { - test: /\.ts$/, - use: "ts-loader", - exclude: /node_modules/, - }, - ], - }, - plugins: [ - new webpack.ProvidePlugin({ - process: "process/browser.js", - Buffer: ["buffer", "Buffer"], - }), - ], - resolve: { - extensions: [".ts", ".js"], - fallback: { - buffer: require.resolve("buffer/"), - crypto: false, - stream: require.resolve("stream-browserify"), - }, - }, - output: { - filename: "[name].min.js", - path: path.resolve(__dirname, "build/umd"), - library: "jswaku", - libraryTarget: "umd", - globalObject: "this", - }, - optimization: { - splitChunks: { - name: "vendors", - chunks: "all", - }, - }, -}; diff --git a/webpack.config.min.bundle.cjs b/webpack.umd.config.cjs similarity index 86% rename from webpack.config.min.bundle.cjs rename to webpack.umd.config.cjs index ec3e1d1c1a..1fa2c884e7 100644 --- a/webpack.config.min.bundle.cjs +++ b/webpack.umd.config.cjs @@ -31,9 +31,9 @@ module.exports = { }, }, output: { - filename: "[name].min.bundle.js", - path: path.resolve(__dirname, "build/umd"), - library: "jswaku", + filename: "index.js", + path: path.resolve(__dirname, "dist/umd"), + library: "waku", libraryTarget: "umd", globalObject: "this", }, From 1fcf84b348fe08a40a7786942d55aa5fbc8ea3f0 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 16 Jun 2022 17:18:41 +1000 Subject: [PATCH 24/26] Fix size-limit --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7952c4d5c9..342e081f4e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "build:cjs": "rollup --config rollup.cjs.config.js -- dist/esm/index.js", "build:umd": "webpack --config webpack.umd.config.cjs", "build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz", - "size": "npm run build:esm && size-limit", + "size": "npm run build && size-limit", "fix": "run-s fix:*", "fix:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --write", "fix:lint": "eslint src --ext .ts --fix", @@ -172,9 +172,9 @@ }, "size-limit": [ { - "path": "dist/esm/index.js", + "path": "dist/umd/index.js", "import": "{ Waku }", - "config": "./webpack.config.cjs" + "config": "./webpack.umd.config.cjs" } ], "lint-staged": { From 8a17631780b8cb25d29bc9c9a6b0f7f1d45b447a Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 17 Jun 2022 10:42:40 +1000 Subject: [PATCH 25/26] Re-introduce file used by Karma --- webpack.config.cjs | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 webpack.config.cjs diff --git a/webpack.config.cjs b/webpack.config.cjs new file mode 100644 index 0000000000..62b1cac614 --- /dev/null +++ b/webpack.config.cjs @@ -0,0 +1,50 @@ +const webpack = require("webpack"); +const path = require("path"); + +module.exports = { + mode: "development", + entry: { + "js-waku": "./src/index.ts", + }, + devtool: "inline-source-map", + module: { + rules: [ + { + test: /\.(js|tsx?)$/, + use: "ts-loader", + exclude: /(node_modules)|(node\.spec\.ts)/, + }, + { + test: /node\.spec\.ts$/, + use: "ignore-loader", + }, + ], + }, + plugins: [ + new webpack.ProvidePlugin({ + process: "process/browser.js", + Buffer: ["buffer", "Buffer"], + }), + ], + resolve: { + extensions: [".ts", ".js"], + fallback: { + buffer: require.resolve("buffer/"), + crypto: false, + stream: require.resolve("stream-browserify"), + }, + }, + output: { + filename: "[name].js", + path: path.resolve(__dirname, "build/umd"), + library: "jswaku", + libraryTarget: "umd", + globalObject: "this", + }, + optimization: { + splitChunks: { + name: "vendors", + chunks: "all", + }, + }, +}; From 862a397e81d1680486fe094a530512efc7830870 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 20 Jun 2022 14:57:49 +1000 Subject: [PATCH 26/26] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d52d07c4..82ebc64906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Published files moved from `build` to `dist/`. - Migrate from ts-proto to protons; the latter does not bring Buffer/Long deps, is ESM compatible and remove the need for bufbuild and protoc. +- Move package to `"type": "module"`. +- Use ESM code in Mocha and Karma tests. ## [0.24.0] - 2022-05-27