Skip to content

feat(export)!: restrict to only root path import #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
"lib",
"es"
],
"exports": {
".": {
"types": "./es/index.d.ts",
"require": "./lib/index.js",
"import": "./es/index.js"
}
},
"scripts": {
"build": "dumi build",
"compile": "father build",
Expand Down
66 changes: 61 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,64 @@
export { default as useEvent } from './hooks/useEvent';
export { default as useMergedState } from './hooks/useMergedState';
export { supportNodeRef, supportRef, useComposeRef } from './ref';
export { default as get } from './utils/get';
export { default as set, merge } from './utils/set';
export { default as warning, noteOnce } from './warning';
export { default as omit } from './omit';
export { default as toArray } from './Children/toArray';
export { default as isFragment } from './React/isFragment';
export { render, unmount } from './React/render';
export { spyElementPrototype, spyElementPrototypes } from './test/domHook';
export { default as composeProps } from './composeProps';
export {
default as getScrollBarSize,
getTargetScrollBarSize,
} from './getScrollBarSize';
export { default as isEqual } from './isEqual';
export { default as isMobile } from './isMobile';
export { default as KeyCode } from './KeyCode';
export { default as omit } from './omit';
export { default as pickAttrs } from './pickAttrs';
export type { PickConfig } from './pickAttrs';
export { default as Portal } from './Portal';
export type { PortalRef, PortalProps } from './Portal';
export { default as PortalWrapper } from './PortalWrapper';
export type { GetContainer, PortalWrapperProps } from './PortalWrapper';
export { default as proxyObject } from './proxyObject';
export { default as wrapperRaf } from './raf';
export {
fillRef,
composeRef,
useComposeRef,
supportRef,
supportNodeRef,
getNodeRef,
} from './ref';
export { default as setStyle } from './setStyle';
export { SetStyleOptions } from './setStyle';
export { default as warning, noteOnce } from './warning';

// DOM
export { default as canUseDom } from './Dom/canUseDom';
export { default as contains } from './Dom/contains';
export type { ContainerType, Prepend, AppendType } from './Dom/dynamicCSS';
export { injectCSS, removeCSS, updateCSS } from './Dom/dynamicCSS';
export { default as findDOMNode, isDOM, getDOM } from './Dom/findDOMNode';
export {
getFocusNodeList,
saveLastFocusNode,
clearLastFocusNode,
backLastFocusNode,
limitTabRange,
} from './Dom/focus';
export { default as isVisible } from './Dom/isVisible';
export { default as ScrollLocker } from './Dom/scrollLocker';
export type { scrollLockOptions } from './Dom/scrollLocker';
export { inShadow, getShadowRoot } from './Dom/shadow';
export { isStyleSupport } from './Dom/styleChecker';

// Hooks
export { default as useEffect } from './hooks/useEffect';
export { default as useEvent } from './hooks/useEvent';
export { default as useId } from './hooks/useId';
export { default as useLayoutEffect } from './hooks/useLayoutEffect';
export { default as useMemo } from './hooks/useMemo';
export { default as useMergedState } from './hooks/useMergedState';
export { default as useMobile } from './hooks/useMobile';
export { default as useState } from './hooks/useState';
export { default as useSyncState } from './hooks/useSyncState';
4 changes: 2 additions & 2 deletions src/test/isEqual.test.ts → tests/isEqual.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import isEqual from '../isEqual';
import warning from '../warning';
import isEqual from '../src/isEqual';
import warning from '../src/warning';

describe('isEqual', () => {
let errorSpy: jest.SpyInstance;
Expand Down
Loading