Merge pull request #49 from waku-org/feat/upgrade-js-waku

chore(js-waku): upgrade to 0.29
This commit is contained in:
Danish Arora 2024-10-18 14:10:34 +05:30 committed by GitHub
commit 559159a04e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 1348 additions and 8127 deletions

9434
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -87,8 +87,7 @@
"typescript": "^4.9.5"
},
"peerDependencies": {
"@waku/interfaces": "^0.0.27",
"@waku/sdk": "^0.0.28",
"@waku/sdk": "^0.0.29",
"react": "^16.8.0 || ^17 || ^18"
},
"peerDependenciesMeta": {

View File

@ -1,5 +1,5 @@
import React from "react";
import type { Waku } from "@waku/interfaces";
import type { IWaku } from "@waku/interfaces";
import type {
BootstrapNodeOptions,
@ -9,9 +9,9 @@ import type {
} from "./types";
import { useCreateLightNode } from "./useCreateWaku";
type WakuContextType<T extends Waku> = CreateNodeResult<T>;
type WakuContextType<T extends IWaku> = CreateNodeResult<T>;
const WakuContext = React.createContext<WakuContextType<Waku>>({
const WakuContext = React.createContext<WakuContextType<IWaku>>({
node: undefined,
isLoading: false,
error: undefined,
@ -29,7 +29,7 @@ const WakuContext = React.createContext<WakuContextType<Waku>>({
* const { node, isLoading, error } = useWaku();
* @returns WakuContext
*/
export const useWaku = <T extends Waku>(): WakuContextType<T> =>
export const useWaku = <T extends IWaku>(): WakuContextType<T> =>
React.useContext(WakuContext) as WakuContextType<T>;
type ProviderProps<T> = ReactChildrenProps & BootstrapNodeOptions<T>;

View File

@ -1,4 +1,4 @@
import type { Protocols, Waku } from "@waku/interfaces";
import type { IWaku, Protocols } from "@waku/interfaces";
import type { waku } from "@waku/sdk";
export type { CreateWakuNodeOptions } from "@waku/sdk";
@ -7,7 +7,7 @@ export type HookState = {
error: undefined | string;
};
export type CreateNodeResult<T extends Waku> = HookState & {
export type CreateNodeResult<T extends IWaku> = HookState & {
node: undefined | T;
};

View File

@ -1,5 +1,5 @@
import React from "react";
import type { LightNode, Waku } from "@waku/interfaces";
import type { IWaku, LightNode } from "@waku/interfaces";
import { createLightNode, waitForRemotePeer } from "@waku/sdk";
import type {
@ -10,11 +10,11 @@ import type {
type NodeFactory<N, T = {}> = (options?: T) => Promise<N>;
type CreateNodeParams<N extends Waku, T = {}> = BootstrapNodeOptions<T> & {
type CreateNodeParams<N extends IWaku, T = {}> = BootstrapNodeOptions<T> & {
factory: NodeFactory<N, T>;
};
const useCreateNode = <N extends Waku, T = {}>(
const useCreateNode = <N extends IWaku, T = {}>(
params: CreateNodeParams<N, T>,
): CreateNodeResult<N> => {
const { factory, options, protocols = [] } = params;

View File

@ -3,13 +3,13 @@ import type {
IDecodedMessage,
IDecoder,
IFilter,
IWaku,
Unsubscribe,
Waku,
} from "@waku/interfaces";
import type { HookState } from "./types";
type AbstractFilterNode = Waku & {
type AbstractFilterNode = IWaku & {
filter: IFilter;
};

View File

@ -1,14 +1,14 @@
import React from "react";
import type {
IEncoder,
ILightPushSDK,
ILightPush,
IMessage,
IWaku,
SDKProtocolResult,
Waku,
} from "@waku/interfaces";
type AbstractLightPushNode = Waku & {
lightPush: ILightPushSDK;
type AbstractLightPushNode = IWaku & {
lightPush: ILightPush;
};
type UseLightPushParams = {

View File

@ -2,15 +2,15 @@ import React from "react";
import type {
IDecodedMessage,
IDecoder,
IStoreSDK,
IStore,
IWaku,
QueryRequestParams,
Waku,
} from "@waku/interfaces";
import type { HookState } from "./types";
type AbstractStoreNode = Waku & {
store: IStoreSDK;
type AbstractStoreNode = IWaku & {
store: IStore;
};
type UseStoreMessagesParams = {