Skip to content

Commit

Permalink
🐛 fix: fix export
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Sep 6, 2023
1 parent 78778d9 commit 9834327
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 5 deletions.
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@
"license": "MIT",
"author": "LobeHub <[email protected]>",
"sideEffects": false,
"exports": {
"./package.json": "./package.json",
".": {
"import": "./es/index.js",
"require": "./lib/index.js",
"default": "./es/index.js",
"types": "./lib/index.d.ts"
},
"./react": {
"import": {
"types": "./es/react/index.d.ts",
"default": "./es/react/index.js"
},
"require": {
"types": "./lib/react/index.d.ts",
"node": "./lib/react/index.js",
"default": "./lib/react/index.js"
}
}
},
"main": "lib/index.js",
"module": "es/index.js",
"types": "lib/index.d.ts",
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/render/index.ts → src/browser/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './const';
export * from './hooks';
export { fetchPluginMessage } from './message';
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './browser';
export * from './error';
export * from './render';
export * from './request';
export * from './schema/manifest';
export * from './schema/market';
Expand Down
2 changes: 2 additions & 0 deletions src/react.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './browser';
export * from './react';
1 change: 1 addition & 0 deletions src/react/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './useWatchPluginMessage';
5 changes: 2 additions & 3 deletions src/render/hooks.ts → src/react/useWatchPluginMessage.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useEffect, useState } from 'react';

import { PluginChannel } from '@/browser';
import { onReceiveData } from '@/browser/utils';
import { PluginRenderProps } from '@/types';

import { PluginChannel } from './const';
import { onReceiveData } from './utils';

export const useWatchPluginMessage = <T = any>() => {
const [result, setData] = useState<{ data: T; loading: boolean }>({
data: undefined as T,
Expand Down

0 comments on commit 9834327

Please sign in to comment.