Merge pull request #1109 from waku-org/chore/typedoc-warnings

This commit is contained in:
fryorcraken.eth 2022-12-23 09:33:23 +11:00 committed by GitHub
commit 2cd1ac2e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 94 additions and 67 deletions

68
package-lock.json generated
View File

@ -32,7 +32,8 @@
"multi-semantic-release": "^3.0.1", "multi-semantic-release": "^3.0.1",
"semantic-release": "^19.0.5", "semantic-release": "^19.0.5",
"size-limit": "^8.1.0", "size-limit": "^8.1.0",
"typedoc": "^0.23.19" "typedoc": "^0.23.23",
"typedoc-plugin-resolve-crossmodule-references": "^0.3.3"
} }
}, },
"node_modules/@achingbrain/ip-address": { "node_modules/@achingbrain/ip-address": {
@ -15111,9 +15112,9 @@
} }
}, },
"node_modules/marked": { "node_modules/marked": {
"version": "4.1.1", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.4.tgz",
"integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", "integrity": "sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA==",
"bin": { "bin": {
"marked": "bin/marked.js" "marked": "bin/marked.js"
}, },
@ -25773,14 +25774,14 @@
} }
}, },
"node_modules/typedoc": { "node_modules/typedoc": {
"version": "0.23.19", "version": "0.23.23",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.19.tgz", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.23.tgz",
"integrity": "sha512-70jPL0GQnSJtgQqI7ifOWxpTXrB3sxc4SWPPRn3K0wdx3txI6ZIT/ZYMF39dNg2Gjmql45cO+cAKXJp0TpqOVA==", "integrity": "sha512-cg1YQWj+/BU6wq74iott513U16fbrPCbyYs04PHZgvoKJIc6EY4xNobyDZh4KMfRGW8Yjv6wwIzQyoqopKOUGw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lunr": "^2.3.9", "lunr": "^2.3.9",
"marked": "^4.0.19", "marked": "^4.2.4",
"minimatch": "^5.1.0", "minimatch": "^5.1.1",
"shiki": "^0.11.1" "shiki": "^0.11.1"
}, },
"bin": { "bin": {
@ -25790,7 +25791,19 @@
"node": ">= 14.14" "node": ">= 14.14"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "4.6.x || 4.7.x || 4.8.x" "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x"
}
},
"node_modules/typedoc-plugin-resolve-crossmodule-references": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/typedoc-plugin-resolve-crossmodule-references/-/typedoc-plugin-resolve-crossmodule-references-0.3.3.tgz",
"integrity": "sha512-ZWWBy2WR8z9a6iXYGlyB3KrpV+JDdZv1mndYU6Eh6mInrfMCrQJi3Y5K9ihMBfuaBGB//le1nEmQLgzU3IO+dw==",
"dev": true,
"engines": {
"node": ">=14"
},
"peerDependencies": {
"typedoc": ">=0.22 <=0.23"
} }
}, },
"node_modules/typedoc/node_modules/brace-expansion": { "node_modules/typedoc/node_modules/brace-expansion": {
@ -25803,9 +25816,9 @@
} }
}, },
"node_modules/typedoc/node_modules/minimatch": { "node_modules/typedoc/node_modules/minimatch": {
"version": "5.1.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
"integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"brace-expansion": "^2.0.1" "brace-expansion": "^2.0.1"
@ -38940,9 +38953,9 @@
"integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==" "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw=="
}, },
"marked": { "marked": {
"version": "4.1.1", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.4.tgz",
"integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==" "integrity": "sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA=="
}, },
"marked-terminal": { "marked-terminal": {
"version": "5.1.1", "version": "5.1.1",
@ -46347,14 +46360,14 @@
} }
}, },
"typedoc": { "typedoc": {
"version": "0.23.19", "version": "0.23.23",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.19.tgz", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.23.tgz",
"integrity": "sha512-70jPL0GQnSJtgQqI7ifOWxpTXrB3sxc4SWPPRn3K0wdx3txI6ZIT/ZYMF39dNg2Gjmql45cO+cAKXJp0TpqOVA==", "integrity": "sha512-cg1YQWj+/BU6wq74iott513U16fbrPCbyYs04PHZgvoKJIc6EY4xNobyDZh4KMfRGW8Yjv6wwIzQyoqopKOUGw==",
"dev": true, "dev": true,
"requires": { "requires": {
"lunr": "^2.3.9", "lunr": "^2.3.9",
"marked": "^4.0.19", "marked": "^4.2.4",
"minimatch": "^5.1.0", "minimatch": "^5.1.1",
"shiki": "^0.11.1" "shiki": "^0.11.1"
}, },
"dependencies": { "dependencies": {
@ -46368,9 +46381,9 @@
} }
}, },
"minimatch": { "minimatch": {
"version": "5.1.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
"integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
"dev": true, "dev": true,
"requires": { "requires": {
"brace-expansion": "^2.0.1" "brace-expansion": "^2.0.1"
@ -46378,6 +46391,13 @@
} }
} }
}, },
"typedoc-plugin-resolve-crossmodule-references": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/typedoc-plugin-resolve-crossmodule-references/-/typedoc-plugin-resolve-crossmodule-references-0.3.3.tgz",
"integrity": "sha512-ZWWBy2WR8z9a6iXYGlyB3KrpV+JDdZv1mndYU6Eh6mInrfMCrQJi3Y5K9ihMBfuaBGB//le1nEmQLgzU3IO+dw==",
"dev": true,
"requires": {}
},
"typescript": { "typescript": {
"version": "4.8.4", "version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",

View File

@ -28,7 +28,7 @@
"proto": "npm run proto --workspaces --if-present", "proto": "npm run proto --workspaces --if-present",
"deploy": "node ci/deploy.js", "deploy": "node ci/deploy.js",
"doc": "run-s doc:*", "doc": "run-s doc:*",
"doc:html": "typedoc # --treatWarningsAsErrors", "doc:html": "typedoc --options typedoc.cjs --treatWarningsAsErrors",
"doc:cname": "echo 'js.waku.org' > docs/CNAME", "doc:cname": "echo 'js.waku.org' > docs/CNAME",
"release": "multi-semantic-release" "release": "multi-semantic-release"
}, },
@ -46,7 +46,8 @@
"multi-semantic-release": "^3.0.1", "multi-semantic-release": "^3.0.1",
"semantic-release": "^19.0.5", "semantic-release": "^19.0.5",
"size-limit": "^8.1.0", "size-limit": "^8.1.0",
"typedoc": "^0.23.19" "typedoc": "^0.23.23",
"typedoc-plugin-resolve-crossmodule-references": "^0.3.3"
}, },
"release": { "release": {
"branches": [ "branches": [

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Fixed
- Documentation links.
## [@waku/core@0.0.8] - 2022-12-19 ## [@waku/core@0.0.8] - 2022-12-19
### Fixed ### Fixed

View File

@ -6,9 +6,10 @@ export {
createDecoder, createDecoder,
DecodedMessage, DecodedMessage,
} from "./lib/message/version_0.js"; } from "./lib/message/version_0.js";
export * as message from "./lib/message/index.js";
export * as waku from "./lib/waku.js"; export * as waku from "./lib/waku.js";
export { WakuNode } from "./lib/waku.js"; export { WakuNode, WakuOptions } from "./lib/waku.js";
export * as waku_filter from "./lib/filter/index.js"; export * as waku_filter from "./lib/filter/index.js";
export { wakuFilter } from "./lib/filter/index.js"; export { wakuFilter } from "./lib/filter/index.js";
@ -17,7 +18,7 @@ export * as waku_light_push from "./lib/light_push/index.js";
export { wakuLightPush, LightPushCodec } from "./lib/light_push/index.js"; export { wakuLightPush, LightPushCodec } from "./lib/light_push/index.js";
export * as waku_relay from "./lib/relay/index.js"; export * as waku_relay from "./lib/relay/index.js";
export { wakuRelay } from "./lib/relay/index.js"; export { wakuRelay, RelayCreateOptions } from "./lib/relay/index.js";
export * as waku_store from "./lib/store/index.js"; export * as waku_store from "./lib/store/index.js";
export { export {

View File

@ -0,0 +1,2 @@
export * as version_0 from "./version_0.js";
export * as topic_only_message from "./topic_only_message.js";

View File

@ -3,7 +3,7 @@ import type {
IDecoder, IDecoder,
IProtoMessage, IProtoMessage,
} from "@waku/interfaces"; } from "@waku/interfaces";
import { proto_topic_only_message as proto } from "@waku/proto"; import { TopicOnlyMessage as ProtoTopicOnlyMessage } from "@waku/proto";
import debug from "debug"; import debug from "debug";
const log = debug("waku:message:topic-only"); const log = debug("waku:message:topic-only");
@ -14,7 +14,7 @@ export class TopicOnlyMessage implements IDecodedMessage {
public timestamp: undefined; public timestamp: undefined;
public ephemeral: undefined; public ephemeral: undefined;
constructor(private proto: proto.TopicOnlyMessage) {} constructor(private proto: ProtoTopicOnlyMessage) {}
get contentTopic(): string { get contentTopic(): string {
return this.proto.contentTopic ?? ""; return this.proto.contentTopic ?? "";
@ -25,7 +25,7 @@ export class TopicOnlyDecoder implements IDecoder<TopicOnlyMessage> {
public contentTopic = ""; public contentTopic = "";
fromWireToProtoObj(bytes: Uint8Array): Promise<IProtoMessage | undefined> { fromWireToProtoObj(bytes: Uint8Array): Promise<IProtoMessage | undefined> {
const protoMessage = proto.TopicOnlyMessage.decode(bytes); const protoMessage = ProtoTopicOnlyMessage.decode(bytes);
log("Message decoded", protoMessage); log("Message decoded", protoMessage);
return Promise.resolve({ return Promise.resolve({
contentTopic: protoMessage.contentTopic, contentTopic: protoMessage.contentTopic,

View File

@ -30,7 +30,7 @@ export type Observer<T extends IDecodedMessage> = {
callback: Callback<T>; callback: Callback<T>;
}; };
export type CreateOptions = { export interface RelayCreateOptions extends GossipsubOpts {
/** /**
* The PubSub Topic to use. Defaults to {@link DefaultPubSubTopic}. * The PubSub Topic to use. Defaults to {@link DefaultPubSubTopic}.
* *
@ -45,7 +45,7 @@ export type CreateOptions = {
* @default {@link DefaultPubSubTopic} * @default {@link DefaultPubSubTopic}
*/ */
pubSubTopic?: string; pubSubTopic?: string;
} & GossipsubOpts; }
/** /**
* Implements the [Waku v2 Relay protocol](https://rfc.vac.dev/spec/11/). * Implements the [Waku v2 Relay protocol](https://rfc.vac.dev/spec/11/).
@ -66,7 +66,7 @@ class Relay extends GossipSub implements IRelay {
constructor( constructor(
components: GossipSubComponents, components: GossipSubComponents,
options?: Partial<CreateOptions> options?: Partial<RelayCreateOptions>
) { ) {
options = Object.assign(options ?? {}, { options = Object.assign(options ?? {}, {
// Ensure that no signature is included nor expected in the messages. // Ensure that no signature is included nor expected in the messages.
@ -188,7 +188,7 @@ class Relay extends GossipSub implements IRelay {
Relay.multicodec = constants.RelayCodecs[constants.RelayCodecs.length - 1]; Relay.multicodec = constants.RelayCodecs[constants.RelayCodecs.length - 1];
export function wakuRelay( export function wakuRelay(
init: Partial<CreateOptions> = {} init: Partial<RelayCreateOptions> = {}
): (components: GossipSubComponents) => IRelay { ): (components: GossipSubComponents) => IRelay {
return (components: GossipSubComponents) => new Relay(components, init); return (components: GossipSubComponents) => new Relay(components, init);
} }

View File

@ -14,8 +14,8 @@ const log = debug("waku:wait-for-remote-peer");
/** /**
* Wait for a remote peer to be ready given the passed protocols. * Wait for a remote peer to be ready given the passed protocols.
* Must be used after attempting to connect to nodes, using * Must be used after attempting to connect to nodes, using
* {@link index.waku.WakuNode.dial} or a bootstrap method with * {@link @waku/core.WakuNode.dial} or a bootstrap method with
* {@link lib/create_waku.createLightNode}. * {@link @waku/create.createLightNode}.
* *
* If the passed protocols is a GossipSub protocol, then it resolves only once * If the passed protocols is a GossipSub protocol, then it resolves only once
* a peer is in a mesh, to help ensure that other peers will send and receive * a peer is in a mesh, to help ensure that other peers will send and receive

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Fixed
- Documentation links.
## [0.0.6] - 2022-12-19 ## [0.0.6] - 2022-12-19
### Fixed ### Fixed

View File

@ -5,11 +5,11 @@ import { mplex } from "@libp2p/mplex";
import { webSockets } from "@libp2p/websockets"; import { webSockets } from "@libp2p/websockets";
import { all as filterAll } from "@libp2p/websockets/filters"; import { all as filterAll } from "@libp2p/websockets/filters";
import { import {
waku, RelayCreateOptions,
waku_relay,
wakuFilter, wakuFilter,
wakuLightPush, wakuLightPush,
WakuNode, WakuNode,
WakuOptions,
wakuRelay, wakuRelay,
wakuStore, wakuStore,
} from "@waku/core"; } from "@waku/core";
@ -24,9 +24,6 @@ import type { Libp2pComponents } from "./libp2p_components.js";
export { Libp2pComponents }; export { Libp2pComponents };
type WakuOptions = waku.WakuOptions;
type RelayCreateOptions = waku_relay.CreateOptions;
export interface CreateOptions { export interface CreateOptions {
/** /**
* The PubSub Topic to use. * The PubSub Topic to use.
@ -41,11 +38,11 @@ export interface CreateOptions {
*/ */
pubSubTopic?: string; pubSubTopic?: string;
/** /**
* You can pass options to the `Libp2p` instance used by {@link index.waku.WakuNode} using the {@link CreateOptions.libp2p} property. * You can pass options to the `Libp2p` instance used by {@link @waku/core.WakuNode} using the {@link CreateOptions.libp2p} property.
* This property is the same type than the one passed to [`Libp2p.create`](https://github.com/libp2p/js-libp2p/blob/master/doc/API.md#create) * This property is the same type as the one passed to [`Libp2p.create`](https://github.com/libp2p/js-libp2p/blob/master/doc/API.md#create)
* apart that we made the `modules` property optional and partial, * apart that we made the `modules` property optional and partial,
* allowing its omission and letting Waku set good defaults. * allowing its omission and letting Waku set good defaults.
* Notes that some values are overridden by {@link index.waku.WakuNode} to ensure it implements the Waku protocol. * Notes that some values are overridden by {@link @waku/core.WakuNode} to ensure it implements the Waku protocol.
*/ */
libp2p?: Partial<Libp2pOptions>; libp2p?: Partial<Libp2pOptions>;
/** /**

View File

@ -11,12 +11,12 @@ import debug from "debug";
import { DnsNodeDiscovery, NodeCapabilityCount } from "./dns.js"; import { DnsNodeDiscovery, NodeCapabilityCount } from "./dns.js";
export { NodeCapabilityCount };
const log = debug("waku:peer-discovery-dns"); const log = debug("waku:peer-discovery-dns");
/** /**
* Parse options and expose function to return bootstrap peer addresses. * Parse options and expose function to return bootstrap peer addresses.
*
* @throws if an invalid combination of options is passed, see [[BootstrapOptions]] for details.
*/ */
export class PeerDiscoveryDns export class PeerDiscoveryDns
extends EventEmitter<PeerDiscoveryEvents> extends EventEmitter<PeerDiscoveryEvents>

View File

@ -1 +1 @@
export { wakuPeerExchange, PeerExchangeCodec } from "./waku_peer_exchange.js"; export * from "./waku_peer_exchange.js";

View File

@ -2,6 +2,7 @@ export * as proto_message from "./lib/message.js";
export { WakuMessage } from "./lib/filter.js"; export { WakuMessage } from "./lib/filter.js";
export * as proto_topic_only_message from "./lib/topic_only_message.js"; export * as proto_topic_only_message from "./lib/topic_only_message.js";
export { TopicOnlyMessage } from "./lib/topic_only_message.js";
export * as proto_filter from "./lib/filter.js"; export * as proto_filter from "./lib/filter.js";

16
typedoc.cjs Normal file
View File

@ -0,0 +1,16 @@
const packageJson = require("./package.json");
// Pop last value out: packages/tests
packageJson.workspaces.pop();
module.exports = {
entryPointStrategy: "packages",
entryPoints: packageJson.workspaces,
out: "docs",
exclude: ["**/*.spec.ts"],
excludeInternal: true,
validation: {
invalidLink: true,
notExported: true,
},
};
packageJson.workspaces;

View File

@ -1,19 +0,0 @@
{
"entryPointStrategy": "packages",
"entryPoints": [
"packages/byte-utils",
"packages/core",
"packages/create",
"packages/dns-discovery",
"packages/enr",
"packages/interfaces",
"packages/message-encryption"
],
"out": "docs",
"exclude": ["**/*.spec.ts"],
"excludeInternal": true,
"validation": {
"invalidLink": true,
"notExported": true
}
}