diff --git a/package-lock.json b/package-lock.json index d5b4b905c2..75ea293c1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5280,6 +5280,14 @@ "resolved": "packages/create", "link": true }, + "node_modules/@waku/dns-discovery": { + "resolved": "packages/dns-discovery", + "link": true + }, + "node_modules/@waku/enr": { + "resolved": "packages/enr", + "link": true + }, "node_modules/@waku/interfaces": { "resolved": "packages/interfaces", "link": true @@ -22516,6 +22524,72 @@ "node": ">=16" } }, + "packages/dns-discovery": { + "version": "0.0.1", + "license": "MIT OR Apache-2.0", + "devDependencies": { + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^8.0.6", + "@semantic-release/npm": "^9.0.1", + "@semantic-release/release-notes-generator": "^10.0.3", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "cspell": "^5.14.0", + "eslint": "^8.6.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^4.0.2", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-prettier": "^4.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "rollup": "^2.75.0", + "semantic-release": "^19.0.5", + "semantic-release-monorepo": "^7.0.5", + "typescript": "^4.6.3" + }, + "engines": { + "node": ">=16" + } + }, + "packages/enr": { + "version": "0.0.1", + "license": "MIT OR Apache-2.0", + "devDependencies": { + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^8.0.6", + "@semantic-release/npm": "^9.0.1", + "@semantic-release/release-notes-generator": "^10.0.3", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "cspell": "^5.14.0", + "eslint": "^8.6.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^4.0.2", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-prettier": "^4.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "rollup": "^2.75.0", + "semantic-release": "^19.0.5", + "semantic-release-monorepo": "^7.0.5", + "typescript": "^4.6.3" + }, + "engines": { + "node": ">=16" + } + }, "packages/interfaces": { "name": "@waku/interfaces", "version": "0.0.1", @@ -26984,6 +27058,64 @@ "typescript": "^4.6.3" } }, + "@waku/dns-discovery": { + "version": "file:packages/dns-discovery", + "requires": { + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^8.0.6", + "@semantic-release/npm": "^9.0.1", + "@semantic-release/release-notes-generator": "^10.0.3", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "cspell": "^5.14.0", + "eslint": "^8.6.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^4.0.2", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-prettier": "^4.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "rollup": "^2.75.0", + "semantic-release": "^19.0.5", + "semantic-release-monorepo": "^7.0.5", + "typescript": "^4.6.3" + } + }, + "@waku/enr": { + "version": "file:packages/enr", + "requires": { + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^8.0.6", + "@semantic-release/npm": "^9.0.1", + "@semantic-release/release-notes-generator": "^10.0.3", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "cspell": "^5.14.0", + "eslint": "^8.6.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^4.0.2", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-prettier": "^4.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "rollup": "^2.75.0", + "semantic-release": "^19.0.5", + "semantic-release-monorepo": "^7.0.5", + "typescript": "^4.6.3" + } + }, "@waku/interfaces": { "version": "file:packages/interfaces", "requires": { diff --git a/packages/dns-discovery/package.json b/packages/dns-discovery/package.json new file mode 100644 index 0000000000..27edee5abd --- /dev/null +++ b/packages/dns-discovery/package.json @@ -0,0 +1,177 @@ +{ + "name": "@waku/dns-discovery", + "version": "0.0.1", + "description": "DNS Peer Discovery (EIP-1459)", + "types": "./dist/index.d.ts", + "module": "./dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "type": "module", + "author": "Waku Team", + "homepage": "https://github.com/waku-org/js-waku/tree/master/packages/dns-discovery#readme", + "repository": { + "type": "git", + "url": "https://github.com/waku-org/js-waku.git" + }, + "bugs": { + "url": "https://github.com/waku-org/js-waku/issues" + }, + "license": "MIT OR Apache-2.0", + "keywords": [ + "waku", + "decentralized", + "secure", + "communication", + "web3", + "ethereum", + "dapps", + "privacy" + ], + "scripts": { + "build": "run-s build:**", + "build:esm": "tsc", + "build:bundle": "rollup --config rollup.config.js", + "fix": "run-s fix:*", + "fix:prettier": "prettier . --write", + "fix:lint": "eslint src --ext .ts --ext .cjs --fix", + "check": "run-s check:*", + "check:lint": "eslint src --ext .ts", + "check:prettier": "prettier . --list-different", + "check:spelling": "cspell \"{README.md,src/**/*.ts}\"", + "check:tsc": "tsc -p tsconfig.dev.json", + "prepublish": "npm run build", + "reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build", + "release": "semantic-release" + }, + "engines": { + "node": ">=16" + }, + "dependencies": {}, + "devDependencies": { + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^8.0.6", + "@semantic-release/npm": "^9.0.1", + "@semantic-release/release-notes-generator": "^10.0.3", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "cspell": "^5.14.0", + "eslint": "^8.6.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^4.0.2", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-prettier": "^4.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "rollup": "^2.75.0", + "semantic-release": "^19.0.5", + "semantic-release-monorepo": "^7.0.5", + "typescript": "^4.6.3" + }, + "release": { + "branches": [ + "master" + ], + "extends": "semantic-release-monorepo", + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "breaking": true, + "release": "patch" + }, + { + "revert": true, + "release": "patch" + }, + { + "type": "feat", + "release": "patch" + }, + { + "type": "fix", + "release": "patch" + }, + { + "type": "doc", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "scope": "deps", + "release": "patch" + }, + { + "scope": "no-release", + "release": false + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "section": "Trivial Changes" + }, + { + "type": "doc", + "section": "Documentation" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github", + "@semantic-release/git" + ] + }, + "typedoc": { + "entryPoint": "./src/index.ts" + }, + "files": [ + "dist", + "bundle", + "src/*.ts", + "src/lib/**/*.ts", + "src/proto/**/*.ts", + "!**/*.spec.*", + "!**/*.json", + "CHANGELOG.md", + "LICENSE", + "README.md" + ] +} diff --git a/packages/dns-discovery/rollup.config.js b/packages/dns-discovery/rollup.config.js new file mode 100644 index 0000000000..d22d3d231e --- /dev/null +++ b/packages/dns-discovery/rollup.config.js @@ -0,0 +1,21 @@ +import commonjs from "@rollup/plugin-commonjs"; +import json from "@rollup/plugin-json"; +import { nodeResolve } from "@rollup/plugin-node-resolve"; + +export default { + input: { + index: "dist/index.js", + }, + output: { + dir: "bundle", + format: "esm", + }, + plugins: [ + commonjs(), + json(), + nodeResolve({ + browser: true, + preferBuiltins: false, + }), + ], +}; diff --git a/packages/core/src/lib/peer_discovery_dns/dns.spec.ts b/packages/dns-discovery/src/dns.spec.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/dns.spec.ts rename to packages/dns-discovery/src/dns.spec.ts diff --git a/packages/core/src/lib/peer_discovery_dns/dns.ts b/packages/dns-discovery/src/dns.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/dns.ts rename to packages/dns-discovery/src/dns.ts diff --git a/packages/core/src/lib/peer_discovery_dns/dns_over_https.ts b/packages/dns-discovery/src/dns_over_https.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/dns_over_https.ts rename to packages/dns-discovery/src/dns_over_https.ts diff --git a/packages/core/src/lib/peer_discovery_dns/enrtree.spec.ts b/packages/dns-discovery/src/enrtree.spec.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/enrtree.spec.ts rename to packages/dns-discovery/src/enrtree.spec.ts diff --git a/packages/core/src/lib/peer_discovery_dns/enrtree.ts b/packages/dns-discovery/src/enrtree.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/enrtree.ts rename to packages/dns-discovery/src/enrtree.ts diff --git a/packages/core/src/lib/peer_discovery_dns/fetch_nodes.spec.ts b/packages/dns-discovery/src/fetch_nodes.spec.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/fetch_nodes.spec.ts rename to packages/dns-discovery/src/fetch_nodes.spec.ts diff --git a/packages/core/src/lib/peer_discovery_dns/fetch_nodes.ts b/packages/dns-discovery/src/fetch_nodes.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/fetch_nodes.ts rename to packages/dns-discovery/src/fetch_nodes.ts diff --git a/packages/core/src/lib/peer_discovery_dns/index.spec.ts b/packages/dns-discovery/src/index.spec.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/index.spec.ts rename to packages/dns-discovery/src/index.spec.ts diff --git a/packages/core/src/lib/peer_discovery_dns/index.ts b/packages/dns-discovery/src/index.ts similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/index.ts rename to packages/dns-discovery/src/index.ts diff --git a/packages/core/src/lib/peer_discovery_dns/testdata.json b/packages/dns-discovery/src/testdata.json similarity index 100% rename from packages/core/src/lib/peer_discovery_dns/testdata.json rename to packages/dns-discovery/src/testdata.json diff --git a/packages/dns-discovery/tsconfig.dev.json b/packages/dns-discovery/tsconfig.dev.json new file mode 100644 index 0000000000..ffc27ef6ba --- /dev/null +++ b/packages/dns-discovery/tsconfig.dev.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "module": "esnext", + "noEmit": true + }, + "exclude": [] +} diff --git a/packages/dns-discovery/tsconfig.json b/packages/dns-discovery/tsconfig.json new file mode 100644 index 0000000000..7b01b30897 --- /dev/null +++ b/packages/dns-discovery/tsconfig.json @@ -0,0 +1,54 @@ +{ + "compilerOptions": { + "incremental": true, + "target": "es2020", + "outDir": "dist/", + "rootDir": "src", + "moduleResolution": "node", + "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'. */, + "resolveJsonModule": true /* Include modules imported with .json extension. */, + "tsBuildInfoFile": "dist/.tsbuildinfo", + "strict": true /* Enable all strict type-checking options. */, + + /* Strict Type-Checking Options */ + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + "strictNullChecks": true /* Enable strict null checks. */, + "strictFunctionTypes": true /* Enable strict checking of function types. */, + "strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, + "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, + "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, + + /* Additional Checks */ + "noUnusedLocals": true /* Report errors on unused locals. */, + "noUnusedParameters": true /* Report errors on unused parameters. */, + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + "forceConsistentCasingInFileNames": true, + + /* Debugging Options */ + "traceResolution": false /* Report module resolution log messages. */, + "listEmittedFiles": false /* Print names of generated files part of the compilation. */, + "listFiles": false /* Print names of files part of the compilation. */, + "pretty": true /* Stylize errors and messages using color and context. */, + + // Due to broken types in indirect dependencies + "skipLibCheck": true, + + /* Experimental Options */ + // "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, + // "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, + + "lib": ["es2020", "dom"], + "types": ["node", "mocha"], + "typeRoots": ["node_modules/@types", "src/types"] + }, + "include": ["src"], + "exclude": ["src/**/*.spec.ts", "src/test_utils"], + "compileOnSave": false, + "ts-node": { + "files": true + } +} diff --git a/packages/enr/package.json b/packages/enr/package.json new file mode 100644 index 0000000000..a6c37c6731 --- /dev/null +++ b/packages/enr/package.json @@ -0,0 +1,177 @@ +{ + "name": "@waku/enr", + "version": "0.0.1", + "description": "ENR (EIP-778) for Waku", + "types": "./dist/index.d.ts", + "module": "./dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "type": "module", + "author": "Waku Team", + "homepage": "https://github.com/waku-org/js-waku/tree/master/packages/enr#readme", + "repository": { + "type": "git", + "url": "https://github.com/waku-org/js-waku.git" + }, + "bugs": { + "url": "https://github.com/waku-org/js-waku/issues" + }, + "license": "MIT OR Apache-2.0", + "keywords": [ + "waku", + "decentralized", + "secure", + "communication", + "web3", + "ethereum", + "dapps", + "privacy" + ], + "scripts": { + "build": "run-s build:**", + "build:esm": "tsc", + "build:bundle": "rollup --config rollup.config.js", + "fix": "run-s fix:*", + "fix:prettier": "prettier . --write", + "fix:lint": "eslint src --ext .ts --ext .cjs --fix", + "check": "run-s check:*", + "check:lint": "eslint src --ext .ts", + "check:prettier": "prettier . --list-different", + "check:spelling": "cspell \"{README.md,src/**/*.ts}\"", + "check:tsc": "tsc -p tsconfig.dev.json", + "prepublish": "npm run build", + "reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build", + "release": "semantic-release" + }, + "engines": { + "node": ">=16" + }, + "dependencies": {}, + "devDependencies": { + "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^8.0.6", + "@semantic-release/npm": "^9.0.1", + "@semantic-release/release-notes-generator": "^10.0.3", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", + "cspell": "^5.14.0", + "eslint": "^8.6.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^4.0.2", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-prettier": "^4.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "rollup": "^2.75.0", + "semantic-release": "^19.0.5", + "semantic-release-monorepo": "^7.0.5", + "typescript": "^4.6.3" + }, + "release": { + "branches": [ + "master" + ], + "extends": "semantic-release-monorepo", + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "breaking": true, + "release": "patch" + }, + { + "revert": true, + "release": "patch" + }, + { + "type": "feat", + "release": "patch" + }, + { + "type": "fix", + "release": "patch" + }, + { + "type": "doc", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "scope": "deps", + "release": "patch" + }, + { + "scope": "no-release", + "release": false + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "section": "Trivial Changes" + }, + { + "type": "doc", + "section": "Documentation" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github", + "@semantic-release/git" + ] + }, + "typedoc": { + "entryPoint": "./src/index.ts" + }, + "files": [ + "dist", + "bundle", + "src/*.ts", + "src/lib/**/*.ts", + "src/proto/**/*.ts", + "!**/*.spec.*", + "!**/*.json", + "CHANGELOG.md", + "LICENSE", + "README.md" + ] +} diff --git a/packages/enr/rollup.config.js b/packages/enr/rollup.config.js new file mode 100644 index 0000000000..d22d3d231e --- /dev/null +++ b/packages/enr/rollup.config.js @@ -0,0 +1,21 @@ +import commonjs from "@rollup/plugin-commonjs"; +import json from "@rollup/plugin-json"; +import { nodeResolve } from "@rollup/plugin-node-resolve"; + +export default { + input: { + index: "dist/index.js", + }, + output: { + dir: "bundle", + format: "esm", + }, + plugins: [ + commonjs(), + json(), + nodeResolve({ + browser: true, + preferBuiltins: false, + }), + ], +}; diff --git a/packages/core/src/lib/enr/constants.ts b/packages/enr/src/constants.ts similarity index 100% rename from packages/core/src/lib/enr/constants.ts rename to packages/enr/src/constants.ts diff --git a/packages/core/src/lib/enr/enr.spec.ts b/packages/enr/src/enr.spec.ts similarity index 100% rename from packages/core/src/lib/enr/enr.spec.ts rename to packages/enr/src/enr.spec.ts diff --git a/packages/core/src/lib/enr/enr.ts b/packages/enr/src/enr.ts similarity index 100% rename from packages/core/src/lib/enr/enr.ts rename to packages/enr/src/enr.ts diff --git a/packages/core/src/lib/enr/index.ts b/packages/enr/src/index.ts similarity index 100% rename from packages/core/src/lib/enr/index.ts rename to packages/enr/src/index.ts diff --git a/packages/core/src/lib/enr/keypair/index.ts b/packages/enr/src/keypair/index.ts similarity index 100% rename from packages/core/src/lib/enr/keypair/index.ts rename to packages/enr/src/keypair/index.ts diff --git a/packages/core/src/lib/enr/keypair/secp256k1.ts b/packages/enr/src/keypair/secp256k1.ts similarity index 100% rename from packages/core/src/lib/enr/keypair/secp256k1.ts rename to packages/enr/src/keypair/secp256k1.ts diff --git a/packages/core/src/lib/enr/keypair/types.ts b/packages/enr/src/keypair/types.ts similarity index 100% rename from packages/core/src/lib/enr/keypair/types.ts rename to packages/enr/src/keypair/types.ts diff --git a/packages/core/src/lib/enr/multiaddr_from_fields.spec.ts b/packages/enr/src/multiaddr_from_fields.spec.ts similarity index 100% rename from packages/core/src/lib/enr/multiaddr_from_fields.spec.ts rename to packages/enr/src/multiaddr_from_fields.spec.ts diff --git a/packages/core/src/lib/enr/multiaddr_from_fields.ts b/packages/enr/src/multiaddr_from_fields.ts similarity index 100% rename from packages/core/src/lib/enr/multiaddr_from_fields.ts rename to packages/enr/src/multiaddr_from_fields.ts diff --git a/packages/core/src/lib/enr/multiaddrs_codec.spec.ts b/packages/enr/src/multiaddrs_codec.spec.ts similarity index 100% rename from packages/core/src/lib/enr/multiaddrs_codec.spec.ts rename to packages/enr/src/multiaddrs_codec.spec.ts diff --git a/packages/core/src/lib/enr/multiaddrs_codec.ts b/packages/enr/src/multiaddrs_codec.ts similarity index 100% rename from packages/core/src/lib/enr/multiaddrs_codec.ts rename to packages/enr/src/multiaddrs_codec.ts diff --git a/packages/core/src/lib/enr/types.ts b/packages/enr/src/types.ts similarity index 100% rename from packages/core/src/lib/enr/types.ts rename to packages/enr/src/types.ts diff --git a/packages/core/src/lib/enr/v4.ts b/packages/enr/src/v4.ts similarity index 100% rename from packages/core/src/lib/enr/v4.ts rename to packages/enr/src/v4.ts diff --git a/packages/core/src/lib/enr/waku2_codec.spec.ts b/packages/enr/src/waku2_codec.spec.ts similarity index 100% rename from packages/core/src/lib/enr/waku2_codec.spec.ts rename to packages/enr/src/waku2_codec.spec.ts diff --git a/packages/core/src/lib/enr/waku2_codec.ts b/packages/enr/src/waku2_codec.ts similarity index 100% rename from packages/core/src/lib/enr/waku2_codec.ts rename to packages/enr/src/waku2_codec.ts diff --git a/packages/enr/tsconfig.dev.json b/packages/enr/tsconfig.dev.json new file mode 100644 index 0000000000..ffc27ef6ba --- /dev/null +++ b/packages/enr/tsconfig.dev.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "module": "esnext", + "noEmit": true + }, + "exclude": [] +} diff --git a/packages/enr/tsconfig.json b/packages/enr/tsconfig.json new file mode 100644 index 0000000000..7b01b30897 --- /dev/null +++ b/packages/enr/tsconfig.json @@ -0,0 +1,54 @@ +{ + "compilerOptions": { + "incremental": true, + "target": "es2020", + "outDir": "dist/", + "rootDir": "src", + "moduleResolution": "node", + "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'. */, + "resolveJsonModule": true /* Include modules imported with .json extension. */, + "tsBuildInfoFile": "dist/.tsbuildinfo", + "strict": true /* Enable all strict type-checking options. */, + + /* Strict Type-Checking Options */ + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + "strictNullChecks": true /* Enable strict null checks. */, + "strictFunctionTypes": true /* Enable strict checking of function types. */, + "strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, + "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, + "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, + + /* Additional Checks */ + "noUnusedLocals": true /* Report errors on unused locals. */, + "noUnusedParameters": true /* Report errors on unused parameters. */, + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + "forceConsistentCasingInFileNames": true, + + /* Debugging Options */ + "traceResolution": false /* Report module resolution log messages. */, + "listEmittedFiles": false /* Print names of generated files part of the compilation. */, + "listFiles": false /* Print names of files part of the compilation. */, + "pretty": true /* Stylize errors and messages using color and context. */, + + // Due to broken types in indirect dependencies + "skipLibCheck": true, + + /* Experimental Options */ + // "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, + // "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, + + "lib": ["es2020", "dom"], + "types": ["node", "mocha"], + "typeRoots": ["node_modules/@types", "src/types"] + }, + "include": ["src"], + "exclude": ["src/**/*.spec.ts", "src/test_utils"], + "compileOnSave": false, + "ts-node": { + "files": true + } +}