@altano/use-element-observer 4.0.2 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,19 +1,15 @@
1
1
  import React from "react";
2
-
3
- //#region src/types.d.ts
4
2
  type ReactElementWithRef = React.ReactElement<{
5
3
  ref: React.Ref<Element>;
6
4
  }>;
7
- //#endregion
8
- //#region src/useElementObserver.d.ts
9
5
  interface Context {
10
6
  mountedElements: Set<Element>;
11
7
  }
12
- declare const ElementObserverContext: React.Context<Context | null>;
13
- type Options = ChildOptions & {
8
+ export declare const ElementObserverContext: React.Context<Context | null>;
9
+ export type Options = ChildOptions & {
14
10
  selector: string;
15
11
  };
16
- type ChildOptions = {
12
+ export type ChildOptions = {
17
13
  useWrapperDiv: false;
18
14
  tree: ReactElementWithRef;
19
15
  } | {
@@ -24,28 +20,23 @@ type ChildOptions = {
24
20
  tree: React.ReactNode;
25
21
  };
26
22
  /**
27
- * Allows observing mount/unmount of elements that match a given selector in the
28
- * given React tree. Tree must be static: only the mounting of the tree itself
29
- * is monitored. If the tree's DOM is dynamically changed those mounts and
30
- * unmounts will not be detected.
31
- *
32
- * @param tree The React tree to observe.
33
- * @param onMount The callback that will be passed any elements in the tree that
34
- * match the given selector, as they mount.
35
- * @param onUnmount The callback that will be passed any elements in the tree
36
- * that match the given selector, as they unmount.
37
- * @param selector The css selector used to select which elements are observed.
38
- * @param useWrapperDiv If `true`, a 'div' will wrap the observed children. If
39
- * `false`, `children` must be a single child element that can take a ref (which
40
- * will be overwritten).
41
- * @returns A tuple of: (1) set of elements and (2) the observed tree to be
42
- * rendered.
43
- */
44
- declare function useElementObserver({
45
- tree,
46
- selector,
47
- useWrapperDiv
48
- }: Options): [Set<Element>, React.ReactElement];
49
- //#endregion
50
- export { ChildOptions, ElementObserverContext, Options, type ReactElementWithRef, useElementObserver };
23
+ * Allows observing mount/unmount of elements that match a given selector in the
24
+ * given React tree. Tree must be static: only the mounting of the tree itself
25
+ * is monitored. If the tree's DOM is dynamically changed those mounts and
26
+ * unmounts will not be detected.
27
+ *
28
+ * @param tree The React tree to observe.
29
+ * @param onMount The callback that will be passed any elements in the tree that
30
+ * match the given selector, as they mount.
31
+ * @param onUnmount The callback that will be passed any elements in the tree
32
+ * that match the given selector, as they unmount.
33
+ * @param selector The css selector used to select which elements are observed.
34
+ * @param useWrapperDiv If `true`, a 'div' will wrap the observed children. If
35
+ * `false`, `children` must be a single child element that can take a ref (which
36
+ * will be overwritten).
37
+ * @returns A tuple of: (1) set of elements and (2) the observed tree to be
38
+ * rendered.
39
+ */
40
+ export declare function useElementObserver({ tree, selector, useWrapperDiv }: Options): [Set<Element>, React.ReactElement];
41
+ export type { ReactElementWithRef };
51
42
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import React, { useCallback, useContext, useEffect, useRef } from "react";
2
2
  import { useSet } from "@uidotdev/usehooks";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
5
- //#region src/useMountRef.tsx
5
+ // src/useMountRef.tsx
6
6
  function useMountRef({ onMount, onUnmount }) {
7
7
  const newRef = useRef(null);
8
8
  useEffect(() => {
@@ -18,15 +18,15 @@ function useMountRef({ onMount, onUnmount }) {
18
18
  return newRef;
19
19
  }
20
20
 
21
- //#endregion
22
- //#region src/Observer.tsx
21
+ // src/Observer.tsx
23
22
  function ObserveChildWithWrapperDiv({ children, onMount, onUnmount }) {
23
+ const ref = useMountRef({
24
+ onMount,
25
+ onUnmount
26
+ });
24
27
  return /* @__PURE__ */ jsx("div", {
25
28
  style: { display: "inherit" },
26
- ref: useMountRef({
27
- onMount,
28
- onUnmount
29
- }),
29
+ ref,
30
30
  children
31
31
  });
32
32
  }
@@ -56,8 +56,7 @@ function Observer({ children, selector, useWrapperDiv }) {
56
56
  });
57
57
  }
58
58
 
59
- //#endregion
60
- //#region src/useElementObserver.tsx
59
+ // src/useElementObserver.tsx
61
60
  const ElementObserverContext = React.createContext(null);
62
61
  /**
63
62
  * Allows observing mount/unmount of elements that match a given selector in the
@@ -93,6 +92,5 @@ function useElementObserver({ tree, selector, useWrapperDiv }) {
93
92
  })];
94
93
  }
95
94
 
96
- //#endregion
97
95
  export { ElementObserverContext, useElementObserver };
98
96
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/useMountRef.tsx","../src/Observer.tsx","../src/useElementObserver.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\nexport interface Callbacks<T> {\n onMount: (e: T) => void;\n onUnmount: (e: T) => void;\n}\n\nexport function useMountRef<T>({\n onMount,\n onUnmount,\n}: Callbacks<T>): React.Ref<T> {\n const newRef = useRef<T>(null);\n useEffect(() => {\n const ref = newRef.current;\n if (ref == null) {\n return (): void => {};\n }\n onMount(ref);\n return (): void => onUnmount(ref);\n }, [newRef, onMount, onUnmount]);\n return newRef;\n}\n","import React, { useCallback, useContext } from \"react\";\nimport { useMountRef, type Callbacks } from \"./useMountRef\";\nimport { ElementObserverContext } from \"./useElementObserver\";\nimport type { ReactElementWithRef } from \"./types\";\n\ninterface ChildrenAndCallbacks<T, ChildType> extends Callbacks<T> {\n children: ChildType;\n}\n\nfunction ObserveChildWithWrapperDiv({\n children,\n onMount,\n onUnmount,\n}: ChildrenAndCallbacks<Element, React.ReactNode>): React.ReactElement {\n const ref = useMountRef<HTMLDivElement>({ onMount, onUnmount });\n return (\n <div style={{ display: \"inherit\" }} ref={ref}>\n {children}\n </div>\n );\n}\n\nfunction ObserveChild({\n children,\n onMount,\n onUnmount,\n}: ChildrenAndCallbacks<Element, ReactElementWithRef>): React.ReactElement {\n const newRef = useMountRef({ onMount, onUnmount });\n return React.cloneElement(children, { ref: newRef });\n}\n\ntype Options =\n | {\n // If we're using a wrapper div...\n useWrapperDiv: true;\n // ... the children can be any ReactNode\n children: React.ReactNode;\n selector: string;\n }\n | {\n // But if we're not using a wrapper div...\n useWrapperDiv: false;\n // The child must be a single ReactElement that takes a ref\n children: ReactElementWithRef;\n selector: string;\n };\n\nexport function Observer({\n children,\n selector,\n useWrapperDiv,\n}: Options): React.ReactElement {\n const context = useContext(ElementObserverContext);\n if (context == null) {\n throw new Error(\"Observer context was null\");\n }\n const { mountedElements } = context;\n const onMount = useCallback(\n (ref: Element) => {\n Array.from(ref.querySelectorAll(selector)).forEach((e) =>\n mountedElements.add(e),\n );\n },\n [selector, mountedElements],\n );\n const onUnmount = useCallback(\n () => mountedElements.clear(),\n [mountedElements],\n );\n return useWrapperDiv ? (\n <ObserveChildWithWrapperDiv onMount={onMount} onUnmount={onUnmount}>\n {children}\n </ObserveChildWithWrapperDiv>\n ) : (\n <ObserveChild onMount={onMount} onUnmount={onUnmount}>\n {children}\n </ObserveChild>\n );\n}\n","import React from \"react\";\nimport { useSet } from \"@uidotdev/usehooks\";\nimport { Observer } from \"./Observer\";\nimport type { ReactElementWithRef } from \"./types\";\n\nexport type { ReactElementWithRef };\n\ninterface Context {\n mountedElements: Set<Element>;\n}\n\nexport const ElementObserverContext: React.Context<Context | null> =\n React.createContext<Context | null>(null);\n\nexport type Options = ChildOptions & {\n selector: string;\n};\n\nexport type ChildOptions =\n | {\n useWrapperDiv: false;\n tree: ReactElementWithRef;\n }\n | {\n useWrapperDiv: true;\n tree: React.ReactNode;\n }\n | {\n useWrapperDiv?: undefined;\n tree: React.ReactNode;\n };\n\n/**\n * Allows observing mount/unmount of elements that match a given selector in the\n * given React tree. Tree must be static: only the mounting of the tree itself\n * is monitored. If the tree's DOM is dynamically changed those mounts and\n * unmounts will not be detected.\n *\n * @param tree The React tree to observe.\n * @param onMount The callback that will be passed any elements in the tree that\n * match the given selector, as they mount.\n * @param onUnmount The callback that will be passed any elements in the tree\n * that match the given selector, as they unmount.\n * @param selector The css selector used to select which elements are observed.\n * @param useWrapperDiv If `true`, a 'div' will wrap the observed children. If\n * `false`, `children` must be a single child element that can take a ref (which\n * will be overwritten).\n * @returns A tuple of: (1) set of elements and (2) the observed tree to be\n * rendered.\n */\nexport function useElementObserver({\n tree,\n selector,\n useWrapperDiv,\n}: Options): [Set<Element>, React.ReactElement] {\n // TODO: Re-compute on every render to catch mutations? Add mutation observer\n // to catch changes to grandchildren?\n const mountedElements = useSet<Element>();\n const observedTree = (\n <ElementObserverContext.Provider value={{ mountedElements }}>\n {useWrapperDiv == null || useWrapperDiv === true ? (\n <Observer selector={selector} useWrapperDiv={true}>\n {tree}\n </Observer>\n ) : (\n <Observer selector={selector} useWrapperDiv={false}>\n {tree}\n </Observer>\n )}\n </ElementObserverContext.Provider>\n );\n return [mountedElements, observedTree];\n}\n"],"mappings":";;;;;AAOA,SAAgB,YAAe,EAC7B,SACA,aAC6B;CAC7B,MAAM,SAAS,OAAU,KAAK;AAC9B,iBAAgB;EACd,MAAM,MAAM,OAAO;AACnB,MAAI,OAAO,KACT,cAAmB;AAErB,UAAQ,IAAI;AACZ,eAAmB,UAAU,IAAI;IAChC;EAAC;EAAQ;EAAS;EAAU,CAAC;AAChC,QAAO;;;;;ACXT,SAAS,2BAA2B,EAClC,UACA,SACA,aACqE;AAErE,QACE,oBAAC,OAAD;EAAK,OAAO,EAAE,SAAS,WAAW;EAAE,KAF1B,YAA4B;GAAE;GAAS;GAAW,CAAC;EAG1D;EACG;;AAIV,SAAS,aAAa,EACpB,UACA,SACA,aACyE;CACzE,MAAM,SAAS,YAAY;EAAE;EAAS;EAAW,CAAC;AAClD,QAAO,MAAM,aAAa,UAAU,EAAE,KAAK,QAAQ,CAAC;;AAmBtD,SAAgB,SAAS,EACvB,UACA,UACA,iBAC8B;CAC9B,MAAM,UAAU,WAAW,uBAAuB;AAClD,KAAI,WAAW,KACb,OAAM,IAAI,MAAM,4BAA4B;CAE9C,MAAM,EAAE,oBAAoB;CAC5B,MAAM,UAAU,aACb,QAAiB;AAChB,QAAM,KAAK,IAAI,iBAAiB,SAAS,CAAC,CAAC,SAAS,MAClD,gBAAgB,IAAI,EAAE,CACvB;IAEH,CAAC,UAAU,gBAAgB,CAC5B;CACD,MAAM,YAAY,kBACV,gBAAgB,OAAO,EAC7B,CAAC,gBAAgB,CAClB;AACD,QAAO,gBACL,oBAAC,4BAAD;EAAqC;EAAoB;EACtD;EAC0B,IAE7B,oBAAC,cAAD;EAAuB;EAAoB;EACxC;EACY;;;;;ACjEnB,MAAa,yBACX,MAAM,cAA8B,KAAK;;;;;;;;;;;;;;;;;;;AAsC3C,SAAgB,mBAAmB,EACjC,MACA,UACA,iBAC8C;CAG9C,MAAM,kBAAkB,QAAiB;AAczC,QAAO,CAAC,iBAZN,oBAAC,uBAAuB,UAAxB;EAAiC,OAAO,EAAE,iBAAiB;YACxD,iBAAiB,QAAQ,kBAAkB,OAC1C,oBAAC,UAAD;GAAoB;GAAU,eAAe;aAC1C;GACQ,IAEX,oBAAC,UAAD;GAAoB;GAAU,eAAe;aAC1C;GACQ;EAEmB,EAEE"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/useMountRef.tsx","../src/Observer.tsx","../src/useElementObserver.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\nexport interface Callbacks<T> {\n onMount: (e: T) => void;\n onUnmount: (e: T) => void;\n}\n\nexport function useMountRef<T>({\n onMount,\n onUnmount,\n}: Callbacks<T>): React.Ref<T> {\n const newRef = useRef<T>(null);\n useEffect(() => {\n const ref = newRef.current;\n if (ref == null) {\n return (): void => {};\n }\n onMount(ref);\n return (): void => onUnmount(ref);\n }, [newRef, onMount, onUnmount]);\n return newRef;\n}\n","import React, { useCallback, useContext } from \"react\";\nimport { useMountRef, type Callbacks } from \"./useMountRef\";\nimport { ElementObserverContext } from \"./useElementObserver\";\nimport type { ReactElementWithRef } from \"./types\";\n\ninterface ChildrenAndCallbacks<T, ChildType> extends Callbacks<T> {\n children: ChildType;\n}\n\nfunction ObserveChildWithWrapperDiv({\n children,\n onMount,\n onUnmount,\n}: ChildrenAndCallbacks<Element, React.ReactNode>): React.ReactElement {\n const ref = useMountRef<HTMLDivElement>({ onMount, onUnmount });\n return (\n <div style={{ display: \"inherit\" }} ref={ref}>\n {children}\n </div>\n );\n}\n\nfunction ObserveChild({\n children,\n onMount,\n onUnmount,\n}: ChildrenAndCallbacks<Element, ReactElementWithRef>): React.ReactElement {\n const newRef = useMountRef({ onMount, onUnmount });\n return React.cloneElement(children, { ref: newRef });\n}\n\ntype Options =\n | {\n // If we're using a wrapper div...\n useWrapperDiv: true;\n // ... the children can be any ReactNode\n children: React.ReactNode;\n selector: string;\n }\n | {\n // But if we're not using a wrapper div...\n useWrapperDiv: false;\n // The child must be a single ReactElement that takes a ref\n children: ReactElementWithRef;\n selector: string;\n };\n\nexport function Observer({\n children,\n selector,\n useWrapperDiv,\n}: Options): React.ReactElement {\n const context = useContext(ElementObserverContext);\n if (context == null) {\n throw new Error(\"Observer context was null\");\n }\n const { mountedElements } = context;\n const onMount = useCallback(\n (ref: Element) => {\n Array.from(ref.querySelectorAll(selector)).forEach((e) =>\n mountedElements.add(e),\n );\n },\n [selector, mountedElements],\n );\n const onUnmount = useCallback(\n () => mountedElements.clear(),\n [mountedElements],\n );\n return useWrapperDiv ? (\n <ObserveChildWithWrapperDiv onMount={onMount} onUnmount={onUnmount}>\n {children}\n </ObserveChildWithWrapperDiv>\n ) : (\n <ObserveChild onMount={onMount} onUnmount={onUnmount}>\n {children}\n </ObserveChild>\n );\n}\n","import React from \"react\";\nimport { useSet } from \"@uidotdev/usehooks\";\nimport { Observer } from \"./Observer\";\nimport type { ReactElementWithRef } from \"./types\";\n\nexport type { ReactElementWithRef };\n\ninterface Context {\n mountedElements: Set<Element>;\n}\n\nexport const ElementObserverContext: React.Context<Context | null> =\n React.createContext<Context | null>(null);\n\nexport type Options = ChildOptions & {\n selector: string;\n};\n\nexport type ChildOptions =\n | {\n useWrapperDiv: false;\n tree: ReactElementWithRef;\n }\n | {\n useWrapperDiv: true;\n tree: React.ReactNode;\n }\n | {\n useWrapperDiv?: undefined;\n tree: React.ReactNode;\n };\n\n/**\n * Allows observing mount/unmount of elements that match a given selector in the\n * given React tree. Tree must be static: only the mounting of the tree itself\n * is monitored. If the tree's DOM is dynamically changed those mounts and\n * unmounts will not be detected.\n *\n * @param tree The React tree to observe.\n * @param onMount The callback that will be passed any elements in the tree that\n * match the given selector, as they mount.\n * @param onUnmount The callback that will be passed any elements in the tree\n * that match the given selector, as they unmount.\n * @param selector The css selector used to select which elements are observed.\n * @param useWrapperDiv If `true`, a 'div' will wrap the observed children. If\n * `false`, `children` must be a single child element that can take a ref (which\n * will be overwritten).\n * @returns A tuple of: (1) set of elements and (2) the observed tree to be\n * rendered.\n */\nexport function useElementObserver({\n tree,\n selector,\n useWrapperDiv,\n}: Options): [Set<Element>, React.ReactElement] {\n // TODO: Re-compute on every render to catch mutations? Add mutation observer\n // to catch changes to grandchildren?\n const mountedElements = useSet<Element>();\n const observedTree = (\n <ElementObserverContext.Provider value={{ mountedElements }}>\n {useWrapperDiv == null || useWrapperDiv === true ? (\n <Observer selector={selector} useWrapperDiv={true}>\n {tree}\n </Observer>\n ) : (\n <Observer selector={selector} useWrapperDiv={false}>\n {tree}\n </Observer>\n )}\n </ElementObserverContext.Provider>\n );\n return [mountedElements, observedTree];\n}\n"],"mappings":";;;;;AAOA,SAAgB,YAAe,EAC7B,SACA,aAC6B;CAC7B,MAAM,SAAS,OAAU,IAAI;CAC7B,gBAAgB;EACd,MAAM,MAAM,OAAO;EACnB,IAAI,OAAO,MACT,aAAmB,CAAC;EAEtB,QAAQ,GAAG;EACX,aAAmB,UAAU,GAAG;CAClC,GAAG;EAAC;EAAQ;EAAS;CAAS,CAAC;CAC/B,OAAO;AACT;;;ACZA,SAAS,2BAA2B,EAClC,UACA,SACA,aACqE;CACrE,MAAM,MAAM,YAA4B;EAAE;EAAS;CAAU,CAAC;CAC9D,OACE,oBAAC,OAAD;EAAK,OAAO,EAAE,SAAS,UAAU;EAAQ;EACtC;CACE;AAET;AAEA,SAAS,aAAa,EACpB,UACA,SACA,aACyE;CACzE,MAAM,SAAS,YAAY;EAAE;EAAS;CAAU,CAAC;CACjD,OAAO,MAAM,aAAa,UAAU,EAAE,KAAK,OAAO,CAAC;AACrD;AAkBA,SAAgB,SAAS,EACvB,UACA,UACA,iBAC8B;CAC9B,MAAM,UAAU,WAAW,sBAAsB;CACjD,IAAI,WAAW,MACb,MAAM,IAAI,MAAM,2BAA2B;CAE7C,MAAM,EAAE,oBAAoB;CAC5B,MAAM,UAAU,aACb,QAAiB;EAChB,MAAM,KAAK,IAAI,iBAAiB,QAAQ,CAAC,CAAC,CAAC,SAAS,MAClD,gBAAgB,IAAI,CAAC,CACvB;CACF,GACA,CAAC,UAAU,eAAe,CAC5B;CACA,MAAM,YAAY,kBACV,gBAAgB,MAAM,GAC5B,CAAC,eAAe,CAClB;CACA,OAAO,gBACL,oBAAC,4BAAD;EAAqC;EAAoB;EACtD;CACyB,KAE5B,oBAAC,cAAD;EAAuB;EAAoB;EACxC;CACW;AAElB;;;ACnEA,MAAa,yBACX,MAAM,cAA8B,IAAI;;;;;;;;;;;;;;;;;;;AAsC1C,SAAgB,mBAAmB,EACjC,MACA,UACA,iBAC8C;CAG9C,MAAM,kBAAkB,OAAgB;CAcxC,OAAO,CAAC,iBAAiB,oBAZtB,uBAAuB,UAAxB;EAAiC,OAAO,EAAE,gBAAgB;YACvD,iBAAiB,QAAQ,kBAAkB,OAC1C,oBAAC,UAAD;GAAoB;GAAU,eAAe;aAC1C;EACO,KAEV,oBAAC,UAAD;GAAoB;GAAU,eAAe;aAC1C;EACO;CAEmB,CAEC,CAAC;AACvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altano/use-element-observer",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "Intersection-Observer-based Scroll Spy React Hook",
5
5
  "homepage": "https://github.com/altano/npm-packages/tree/main/packages/use-element-observer",
6
6
  "repository": {
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "author": {
13
13
  "name": "Alan Norbauer",
14
- "email": "altano@gmail.com",
14
+ "email": "alan@norbauer.com",
15
15
  "url": "https://alan.norbauer.com"
16
16
  },
17
17
  "sideEffects": false,
@@ -27,20 +27,20 @@
27
27
  "@uidotdev/usehooks": "^2.4.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@arethetypeswrong/cli": "^0.18.2",
31
- "@testing-library/react": "^16.3.2",
32
- "@types/react": "^19.2.10",
33
- "@types/react-dom": "^19.2.3",
34
- "@vitest/coverage-v8": "^4.1.0",
30
+ "@arethetypeswrong/cli": "^0.18.5",
31
+ "@testing-library/react": "^16.3.3",
32
+ "@types/react": "^19.3.0",
33
+ "@types/react-dom": "^19.3.0",
34
+ "@vitest/coverage-v8": "^5.1.0",
35
35
  "depcheck": "^1.4.7",
36
- "eslint": "^9.39.4",
37
- "jsdom": "^26.1.0",
38
- "prettier": "^3.8.1",
39
- "react": "^19.2.4",
40
- "tsdown": "^0.21.4",
41
- "typescript": "^5.9.3",
42
- "vite": "^7.3.1",
43
- "vitest": "^4.1.0",
36
+ "eslint": "^10.14.0",
37
+ "jsdom": "^30.1.3",
38
+ "prettier": "3.9.10",
39
+ "react": "^19.3.1",
40
+ "tsdown": "^0.23.5",
41
+ "typescript": "^6.0.3",
42
+ "vite": "^8.3.5",
43
+ "vitest": "^5.1.0",
44
44
  "@altano/build-config": "0.0.1",
45
45
  "@altano/testing": "0.0.1",
46
46
  "@altano/tsconfig": "0.0.1"
@@ -52,15 +52,15 @@
52
52
  "access": "public"
53
53
  },
54
54
  "scripts": {
55
- "build": "tsdown --config-loader unrun --config ../build-config/tsdown.config.browser.ts",
55
+ "build": "tsdown",
56
56
  "check:exports": "attw --pack . --profile esm-only --quiet",
57
57
  "check:types:src": "tsc --noEmit",
58
58
  "check:types:test": "tsc --noEmit --project ./tests/tsconfig.json",
59
59
  "check:unused-dependencies": "depcheck",
60
60
  "clean": "rm -rf .turbo && rm -rf .tsbuildinfo && rm -rf node_modules && rm -rf dist",
61
61
  "dev": "pnpm run build --watch",
62
- "format": "prettier --check src",
63
- "format:fix": "prettier --write src",
62
+ "format": "prettier --check .",
63
+ "format:fix": "prettier --write .",
64
64
  "lint": "eslint",
65
65
  "lint:fix": "TIMING=1 pnpm lint --fix",
66
66
  "lint:timing": "TIMING=1 pnpm lint",