state-in-url 4.1.1 → 4.1.3
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/README.md +5 -4
- package/dist/constants/constants.d.ts +1 -0
- package/dist/constants/constants.mjs +1 -1
- package/dist/constants/index.mjs +1 -1
- package/dist/encodeState/encodeState.mjs +1 -1
- package/dist/encodeState/encodeState.test.d.ts +1 -0
- package/dist/encodeState/index.mjs +1 -1
- package/dist/encoder/encoder.mjs +1 -1
- package/dist/encoder/encoder.test.d.ts +1 -0
- package/dist/encoder/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/next/index.mjs +1 -1
- package/dist/next/useUrlState/index.mjs +1 -1
- package/dist/next/useUrlState/useUrlState.mjs +1 -1
- package/dist/parseSPObj.mjs +1 -1
- package/dist/parseSPObj.test.d.ts +1 -0
- package/dist/react-router/index.mjs +1 -1
- package/dist/react-router/useUrlState/index.mjs +1 -1
- package/dist/react-router/useUrlState/useUrlState.mjs +1 -1
- package/dist/subscribers.d.ts +1 -1
- package/dist/subscribers.mjs +1 -1
- package/dist/useSharedState/index.mjs +1 -1
- package/dist/useSharedState/useSharedState.mjs +1 -1
- package/dist/useSharedState/useSharedState.test.d.ts +14 -0
- package/dist/useUrlEncode/index.mjs +1 -1
- package/dist/useUrlEncode/useUrlEncode.mjs +1 -1
- package/dist/useUrlEncode/useUrlEncode.test.d.ts +1 -0
- package/dist/useUrlStateBase/index.mjs +1 -1
- package/dist/useUrlStateBase/useUrlStateBase.mjs +1 -1
- package/dist/useUrlStateBase/useUrlStateBase.test.d.ts +1 -0
- package/dist/utils.d.ts +2 -1
- package/dist/utils.mjs +1 -1
- package/dist/utils.test.d.ts +1 -0
- package/package.json +17 -10
- package/dist/testUtils.d.ts +0 -1
package/README.md
CHANGED
|
@@ -45,9 +45,9 @@ Add a ⭐️ and <a href="https://github.com/asmyshlyaev177" target="_blank">fol
|
|
|
45
45
|
Will appreciate you feedback/opinion on [discussions](https://github.com/asmyshlyaev177/state-in-url/discussions/1)
|
|
46
46
|
|
|
47
47
|
Share if it useful for you.
|
|
48
|
-
[FB](https://www.facebook.com/sharer.php?u=https://github.com/asmyshlyaev177/state-in-url)
|
|
49
|
-
[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/asmyshlyaev177/state-in-url)
|
|
50
48
|
[X.com](https://twitter.com/intent/tweet?&url=https://github.com/asmyshlyaev177/state-in-url)
|
|
49
|
+
[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/asmyshlyaev177/state-in-url)
|
|
50
|
+
[FB](https://www.facebook.com/sharer.php?u=https://github.com/asmyshlyaev177/state-in-url)
|
|
51
51
|
[VK](http://vk.com/share.php?url=https://github.com/asmyshlyaev177/state-in-url)
|
|
52
52
|
|
|
53
53
|
<hr />
|
|
@@ -56,7 +56,7 @@ Share if it useful for you.
|
|
|
56
56
|
|
|
57
57
|
## Why use `state-in-url`?
|
|
58
58
|
|
|
59
|
-
Store any user state in query parameters; imagine JSON in a browser URL
|
|
59
|
+
Store any user state in query parameters; imagine JSON in a browser URL. All of it with keeping types and structure of data, e.g. numbers will be decoded as numbers not strings, dates as dates, etc, objects and arrays supported.
|
|
60
60
|
Dead simple, fast, and with static Typescript validation. Deep links, aka URL synchronization, made easy.
|
|
61
61
|
|
|
62
62
|
Contains `useUrlState` hook for Next.js and react-router, and helpers for anything else on JS.
|
|
@@ -70,6 +70,7 @@ This library is a good alternative for NUQS.
|
|
|
70
70
|
### Use cases
|
|
71
71
|
|
|
72
72
|
- Store unsaved user forms or page filters in URL
|
|
73
|
+
- Sycn URL with React state
|
|
73
74
|
- Just sync data between unrelated client components without touching URI
|
|
74
75
|
- Shareable URLs with application state (Deep linking, URL state synchronization)
|
|
75
76
|
- Easy state persistence across page reloads
|
|
@@ -81,7 +82,7 @@ This library is a good alternative for NUQS.
|
|
|
81
82
|
- ✨ **Complex data**: Nested objects, dates and arrays, works same as JSON, but in URL
|
|
82
83
|
- ☂ **Default values**: Giving you default values if parameter not in url
|
|
83
84
|
- ⌨ **Organized**: All possible values defined at start, protect you from getting non existing key
|
|
84
|
-
- **Fast**: Minimal rerenders,
|
|
85
|
+
- **Fast**: Minimal rerenders, around [1ms](https://github.com/asmyshlyaev177/state-in-url/blob/87c8c7c995c5cd7d9e7aa039c30bfe64b24abe4b/packages/urlstate/encoder/encoder.test.ts#L185) to encode and decode big object
|
|
85
86
|
- **Server Side Rendering**: Can use it in Server Components, Next.js 14 and 15 are supported
|
|
86
87
|
- **Lightweight**: Zero dependencies, library less than 2KB
|
|
87
88
|
- **DX**: Good developer experience, documentation, JSDoc comments, and examples
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{isSafari as e}from"../utils.mjs";const d={date:"\u23F2",undefined:"\u2219undefined"},i=e?330:70;export{d as SYMBOLS,i as TIMEOUT};
|
package/dist/constants/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{SYMBOLS as M,TIMEOUT as O}from"./constants.mjs";export{M as SYMBOLS,O as TIMEOUT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{encode as
|
|
1
|
+
import{encode as f,decode as a}from"../encoder/encoder.mjs";import{getParams as i}from"../utils.mjs";function m(o,e,n){const r=i(n);return Object.entries(o||{}).forEach(([t,c])=>{const s=e?.[t];JSON.stringify(c)!==JSON.stringify(s)&&r.set(t,f(c))}),r.toString()}function d(o,e){return{...e||{},...Object.fromEntries([...i(o).entries()].map(([n,r])=>{const t=e?.[n];return[n,a(r,t)??t]}))}}export{d as decodeState,m as encodeState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{decodeState as o,encodeState as d}from"./encodeState.mjs";export{o as decodeState,d as encodeState};
|
package/dist/encoder/encoder.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SYMBOLS as
|
|
1
|
+
import{SYMBOLS as r}from"../constants/constants.mjs";import{typeOf as u}from"../utils.mjs";function p(e){return typeof e=="function"||typeof e=="symbol"?"":l(e)?e:JSON.stringify(structuredClone(e),i).replace(/'/g,"%27").replace(/"/g,"'")}function i(e,t){const c=u(t);if(c!=="object"&&c!=="array")return a(t);if(c==="object"){const n=t;return Object.keys(n).forEach(o=>{n[o]=i(e,n[o])}),n}return c==="array"?t.map(n=>i(e,n)):t}const a=e=>{switch(u(e)){case"date":return r.date+new Date(e).toISOString();case"undefined":return r.undefined;default:return e}};function y(e,t){return f(e.replace(/'/g,'"').replace(/%27/g,"'"),t)}function f(e,t){try{return JSON.parse(e,d)}catch{return t}}function d(e,t){return typeof t=="string"?s(t):t}const s=e=>{if(e!==r.undefined)return e?.startsWith?.(r.date)?new Date(e.slice(1)):e},g=new RegExp(`^(${r.undefined}|${r.date})`),l=e=>g.test(String(e));export{y as decode,s as decodePrimitive,p as encode,a as encodePrimitive,f as parseJSON,d as reviver};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/encoder/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{decode as d,encode as c}from"./encoder.mjs";export{d as decode,c as encode};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{decode as r,encode as t}from"./encoder/encoder.mjs";import{decodeState as f,encodeState as p}from"./encodeState/encodeState.mjs";import{useUrlState as a}from"./next/useUrlState/useUrlState.mjs";import{useSharedState as x}from"./useSharedState/useSharedState.mjs";import{useUrlEncode as c}from"./useUrlEncode/useUrlEncode.mjs";import{useUrlStateBase as l}from"./useUrlStateBase/useUrlStateBase.mjs";import{isSSR as U,typeOf as h}from"./utils.mjs";export{r as decode,f as decodeState,t as encode,p as encodeState,U as isSSR,h as typeOf,x as useSharedState,c as useUrlEncode,a as useUrlState,l as useUrlStateBase};
|
package/dist/next/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{useUrlState as t}from"./useUrlState/useUrlState.mjs";export{t as useUrlState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{useUrlState as t}from"./useUrlState.mjs";export{t as useUrlState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRouter as
|
|
1
|
+
import{useRouter as y,useSearchParams as C}from"next/navigation";import s from"react";import{parseSPObj as S}from"../../parseSPObj.mjs";import{useUrlStateBase as H}from"../../useUrlStateBase/useUrlStateBase.mjs";import{routerHistory as R,isSSR as g,filterUnknownParams as f,filterUnknownParamsClient as j}from"../../utils.mjs";function w(t,a){const e="defaultState"in t?t.defaultState:t,d="defaultState"in t?t.searchParams:a?.searchParams,o="defaultState"in t?t.useHistory:a?.useHistory,P="defaultState"in t?{scroll:t.scroll,replace:t.replace}:{scroll:a?.scroll,replace:a?.replace},U=o===void 0||o?R:y(),{state:u,updateState:l,updateUrl:c,reset:i,getState:b}=H(e,U,({parse:r})=>g?S(f(e,d),e):r(j(e))),n=s.useMemo(()=>({...E,...P}),[]),m=s.useCallback((r,k)=>c(r,{...n,...k}),[c]),p=C();s.useEffect(()=>{l(f(e,S(Object.fromEntries([...p.entries()]),e)))},[p]);const h=s.useCallback(r=>{i({...n,...r})},[i]);return{setState:l,updateState:l,setUrl:m,updateUrl:m,urlState:u,state:u,reset:h,getState:b}}const E={replace:!0,scroll:!1};export{w as useUrlState};
|
package/dist/parseSPObj.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{decode as
|
|
1
|
+
import{decode as c}from"./encoder/encoder.mjs";function o(r,t){return{...t,...s(JSON.stringify(r),t)}}function s(r,t){try{return JSON.parse(r,i)}catch{return t}}const i=(r,t)=>{const e=typeof t=="string",n=e&&c(t?.replace?.(/'/g,'"'));return r&&e?n:t};export{o as parseSPObj};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{useUrlState as t}from"./useUrlState/useUrlState.mjs";export{t as useUrlState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{useUrlState as t}from"./useUrlState.mjs";export{t as useUrlState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s from"react";import{useNavigate as b,useSearchParams as g}from"react-router-dom";import{parseSPObj as k}from"../../parseSPObj.mjs";import{useUrlStateBase as C}from"../../useUrlStateBase/useUrlStateBase.mjs";import{routerHistory as P,filterUnknownParamsClient as y,assignValue as H,filterUnknownParams as h}from"../../utils.mjs";function j(t,o){const r="defaultState"in t?t.defaultState:t,f="defaultState"in t?t.useHistory:o?.useHistory,d="defaultState"in t?{replace:t.replace,preventScrollReset:t.preventScrollReset}:{replace:o?.replace,preventScrollReset:o?.preventScrollReset},l=s.useMemo(()=>({...w,...d}),[]),u=b(),U=s.useMemo(()=>f?P:{replace:(e,a)=>u(e,{...l,...a}),push:(e,a)=>u(e,{...l,...a})},[u]),{state:p,updateState:n,updateUrl:c,getState:v,reset:i}=C(r,U,({parse:e})=>e(y(r))),S=s.useCallback((e,a)=>c(e,{...l,...a}),[c]),[m]=g();s.useEffect(()=>{n(H(r,h(r,k(Object.fromEntries([...m.entries()]),r))))},[m]);const R=s.useCallback(e=>{i({...l,...e})},[i]);return{setState:n,updateState:n,setUrl:S,updateUrl:S,urlState:p,state:p,reset:R,getState:v}}const w={replace:!0,preventScrollReset:!0};export{j as useUrlState};
|
package/dist/subscribers.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const subscribers: {
|
|
|
5
5
|
remove(obj: JSONCompatible, cb: Cb): void;
|
|
6
6
|
};
|
|
7
7
|
export declare const stateMap: {
|
|
8
|
-
get: <T extends JSONCompatible>(objKey: T) => T;
|
|
8
|
+
get: <T extends JSONCompatible | undefined>(objKey: T) => T | undefined;
|
|
9
9
|
set: <T extends JSONCompatible>(objKey: T, value: T) => void;
|
|
10
10
|
};
|
|
11
11
|
export type Cb = () => void;
|
package/dist/subscribers.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r=new WeakMap,s=new WeakMap,o={get(t){return s.get(t)||[]},add(t,e){const n=this.get(t);return s.set(t,n.concat(e)),()=>this.remove(t,e)},remove(t,e){const n=this.get(t).filter(c=>c!==e);n.length?s.set(t,n):s.delete(t)}},a={get:function(t){return r.get(t)},set:function(t,e){r.set(t,e)}};export{a as stateMap,o as subscribers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{useSharedState as t}from"./useSharedState.mjs";export{t as useSharedState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"react";import{stateMap as n,subscribers as s}from"../subscribers.mjs";import{useInsertionEffect as g}from"../useInsertionEffect.mjs";import{isSSR as l,isEqual as b}from"../utils.mjs";function d(a,c){const t=u.useRef(a),[f,i]=u.useState(()=>{if(l)return c?c?.():t.current;const e=n.get(t.current);if(e)return e;{const r=c?.()||t.current;return n.set(t.current,r),r}}),m=u.useCallback(e=>{const r=n.get(t.current),o=typeof e=="function"?e(r):{...r,...e};b(r,o)||(n.set(t.current,o),s.get(t.current).forEach(p=>p()))},[]);g(()=>{const e=()=>{i(n.get(t.current)||t.current)},r=s.add(t.current,e);return()=>{r()}},[]);const S=u.useCallback(()=>n.get(t.current)||t.current,[]);return{state:f,getState:S,setState:m}}export{d as useSharedState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{useUrlEncode as r}from"./useUrlEncode.mjs";export{r as useUrlEncode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"react";import{encodeState as a,decodeState as n}from"../encodeState/encodeState.mjs";import{typeOf as f}from"../utils.mjs";function i(e){const c=o.useCallback((t,r)=>f(t)==="object"?a(t,e,r):"",[e]);return{parse:o.useCallback(t=>n(t,e),[e]),stringify:c}}export{i as useUrlEncode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{useUrlStateBase as t}from"./useUrlStateBase.mjs";export{t as useUrlStateBase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"react";import{TIMEOUT as b}from"../constants/constants.mjs";import{useInsertionEffect as L}from"../useInsertionEffect.mjs";import{useSharedState as P}from"../useSharedState/useSharedState.mjs";import{useUrlEncode as y}from"../useUrlEncode/useUrlEncode.mjs";import{filterUnknownParamsClient as C}from"../utils.mjs";function O(t,a,l){const{parse:s,stringify:o}=y(t),{state:m,getState:r,setState:c}=P(t,()=>l?.({parse:s})||t),p=u.useRef(void 0);L(()=>{const e=()=>{const n=s(C(t));c(n)};return window.addEventListener(E,e),()=>{window.removeEventListener(E,e),clearTimeout(p.current)}},[c]);const f=u.useRef([]),w=u.useCallback((e,n)=>{const h=typeof e=="function"?e(r()):e?{...r(),...e}:r(),S=o(h,I(t)),U=`${window.location.pathname}${S.length?"?":""}${S}${window.location.hash}`,k=`${window.location.pathname}${window.location.search}${window.location.hash}`;if(U===k)return;let i;c(h);const T=n?.replace;delete n?.replace,f.current.push([T?"replace":"push",U,n]),clearTimeout(p.current),p.current=setTimeout(()=>{queueMicrotask(()=>{for(;f.current.length;){const d=f.current.shift();d&&d?.[1]!==i?.[1]&&(i=d)}const[$,v,R]=i||{};i=void 0,$&&a[$](v,R)})},b)},[a,o,r]),g=u.useCallback(e=>{w(t,e)},[w]);return{updateState:c,updateUrl:w,state:m,reset:g,getState:r}}function I(t){const a=Object.keys(t),l=window.location.search,s=new URLSearchParams(l),o=new URLSearchParams;return s.forEach((m,r)=>!a.includes(r)&&o.set(r,m)),o}const E="popstate";export{O as useUrlStateBase};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type Type = "string" | "date" | "boolean" | "number" | "bigint" | "undefi
|
|
|
10
10
|
export declare const typeOf: (val: unknown) => Type;
|
|
11
11
|
export declare const isPrimitive: (val: unknown) => val is Simple;
|
|
12
12
|
export type Simple = string | Date | boolean | number | null | undefined | Function | symbol;
|
|
13
|
-
export declare const isSSR:
|
|
13
|
+
export declare const isSSR: boolean;
|
|
14
14
|
export type JSON = null | boolean | Date | number | string | {
|
|
15
15
|
[prop: string]: JSON | JSON[];
|
|
16
16
|
};
|
|
@@ -31,3 +31,4 @@ export interface Router {
|
|
|
31
31
|
replace: (href: string, opts: object) => void;
|
|
32
32
|
}
|
|
33
33
|
export declare const routerHistory: Router;
|
|
34
|
+
export declare const isSafari: boolean;
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c=n=>{const t=typeof n,r=n===null,o=Array.isArray(n),e=n instanceof Date;return r&&"null"||e&&"date"||o&&"array"||!r&&!e&&!o&&t==="object"&&"object"||t},i=typeof window>"u",l=n=>new URLSearchParams(typeof n=="string"?u(n):n?.toString?.()||""),u=n=>n.split("?")?.[1]||n||"",f=(n,t)=>JSON.stringify(n)===JSON.stringify(t);function w(n){const t=new URLSearchParams;return s(n,[...new URLSearchParams(window.location.search).entries()]).forEach(([r,o])=>t.set(r,o)),t.toString()}function p(n,t){return Object.fromEntries(s(n,Object.entries(t||{})))}function s(n,t){const r=Object.keys(n),o=[];for(let e=0;e<t.length;e++)r.includes(t[e]?.[0])&&o.push([t[e][0].replace(/\+/g," "),t[e][1]]);return o}function y(n,t){const r=Object.assign({},n);return Object.entries(n).forEach(([o])=>{const e=o,a=t[e]!==void 0;r[e]=a?t[e]:n[e]}),r}const g={push:n=>{window&&window.history.pushState(null,"",n)},replace:n=>{window&&window.history.replaceState(null,"",n)}},h=/apple/i.test(!i&&navigator?.userAgent||"");export{y as assignValue,s as filterUnknown,p as filterUnknownParams,w as filterUnknownParamsClient,l as getParams,f as isEqual,i as isSSR,h as isSafari,g as routerHistory,c as typeOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "state-in-url",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "Easily share complex state objects between unrelated React components, preserve types and structure, with TS validation. Deep links and url state synchronization wthout any hasssle or boilerplate.",
|
|
5
5
|
"homepage": "https://state-in-url.dev",
|
|
6
6
|
"repository": {
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"dependencies": [
|
|
146
146
|
"tsc"
|
|
147
147
|
],
|
|
148
|
-
"command": "npx
|
|
148
|
+
"command": "npx vitest"
|
|
149
149
|
},
|
|
150
150
|
"dev": {
|
|
151
151
|
"dependencies": [
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"command": "npm run dev:nextjs14"
|
|
163
163
|
},
|
|
164
164
|
"dev:lib": {
|
|
165
|
-
"command": "cross-env IS_DEVELOPMENT=true rollup -c rollup.config.
|
|
165
|
+
"command": "cross-env IS_DEVELOPMENT=true rollup -c rollup.config.mjs -w",
|
|
166
166
|
"service": {
|
|
167
167
|
"readyWhen": {
|
|
168
168
|
"lineMatches": "created "
|
|
@@ -202,6 +202,12 @@
|
|
|
202
202
|
],
|
|
203
203
|
"command": "cd packages/example-nextjs14 && npm run build"
|
|
204
204
|
},
|
|
205
|
+
"build:demo:tests": {
|
|
206
|
+
"dependencies": [
|
|
207
|
+
"build"
|
|
208
|
+
],
|
|
209
|
+
"command": "cd packages/example-nextjs14 && npx cross-env TEST=true npm run build"
|
|
210
|
+
},
|
|
205
211
|
"start:demo": {
|
|
206
212
|
"dependencies": [
|
|
207
213
|
"build:demo"
|
|
@@ -272,7 +278,7 @@
|
|
|
272
278
|
"dependencies": [
|
|
273
279
|
"build",
|
|
274
280
|
"build:react",
|
|
275
|
-
"build:demo",
|
|
281
|
+
"build:demo:tests",
|
|
276
282
|
"build:next15",
|
|
277
283
|
"build:router6"
|
|
278
284
|
]
|
|
@@ -281,7 +287,7 @@
|
|
|
281
287
|
"command": "cd packages/example-react && npm run build"
|
|
282
288
|
},
|
|
283
289
|
"build": {
|
|
284
|
-
"command": "rollup -c rollup.config.
|
|
290
|
+
"command": "rollup -c rollup.config.mjs",
|
|
285
291
|
"dependencies": [
|
|
286
292
|
"rmdist"
|
|
287
293
|
]
|
|
@@ -330,7 +336,6 @@
|
|
|
330
336
|
"@commitlint/config-conventional": "^19.0.3",
|
|
331
337
|
"@playwright/test": "^1.48.2",
|
|
332
338
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
333
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
334
339
|
"@rollup/plugin-typescript": "^12.1.0",
|
|
335
340
|
"@semantic-release/changelog": "^6.0.3",
|
|
336
341
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
@@ -342,10 +347,10 @@
|
|
|
342
347
|
"@testing-library/react": "^16.0.0",
|
|
343
348
|
"@testing-library/react-hooks": "^8.0.1",
|
|
344
349
|
"@types/glob": "^8.1.0",
|
|
345
|
-
"@types/jest": "^29.5.14",
|
|
346
350
|
"@types/node": "^20.11.24",
|
|
347
351
|
"@types/react": "^18.3.3",
|
|
348
352
|
"@types/react-dom": "^18.3.0",
|
|
353
|
+
"@vitest/coverage-istanbul": "^2.1.5",
|
|
349
354
|
"auto-changelog": "^2.4.0",
|
|
350
355
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
351
356
|
"chokidar": "^4.0.1",
|
|
@@ -359,10 +364,10 @@
|
|
|
359
364
|
"eslint-plugin-maintainable": "^0.4.4",
|
|
360
365
|
"eslint-plugin-prettier": "^5.2.1",
|
|
361
366
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
367
|
+
"happy-dom": "^15.11.6",
|
|
362
368
|
"husky": "^9.0.11",
|
|
363
|
-
"jest": "^29.7.0",
|
|
364
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
365
369
|
"lint-staged": "^15.2.9",
|
|
370
|
+
"nyc": "^17.1.0",
|
|
366
371
|
"only-allow": "^1.2.1",
|
|
367
372
|
"pin-github-action": "^1.9.1",
|
|
368
373
|
"playwright": "^1.48.2",
|
|
@@ -370,13 +375,15 @@
|
|
|
370
375
|
"prettier-plugin-tailwindcss": "^0.6.8",
|
|
371
376
|
"release-it": "^17.6.0",
|
|
372
377
|
"rollup": "^4.23.0",
|
|
378
|
+
"rollup-plugin-esbuild": "^6.1.1",
|
|
373
379
|
"rollup-plugin-filesize": "^10.0.0",
|
|
374
380
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
375
381
|
"semantic-release": "^24.1.0",
|
|
376
382
|
"standard-version": "^9.5.0",
|
|
377
|
-
"ts-jest": "^29.2.5",
|
|
378
383
|
"ts-node": "^10.9.2",
|
|
379
384
|
"typescript": "^5.3.3",
|
|
385
|
+
"unplugin-auto-import": "^0.18.5",
|
|
386
|
+
"vitest": "^2.1.5",
|
|
380
387
|
"wait-on": "^8.0.1",
|
|
381
388
|
"wireit": "^0.14.9"
|
|
382
389
|
},
|
package/dist/testUtils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const clone: (obj: object) => any;
|