@elliemae/ds-zustand-helpers 3.15.0 → 3.16.0-next.10

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/AutoUpdaterComponent.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useCallback, useEffect } from 'react';\nimport type { ZustandT } from './types';\n\nexport const AutoUpdaterComponent: ZustandT.AutoUpdaterComponentT = (props) => {\n const { usePropsStore, autoCalculatedData, propsWithDefault, Component } = props;\n const setProps = usePropsStore(useCallback((state) => state.set, []));\n\n useEffect(() => {\n setProps({ ...propsWithDefault, ...autoCalculatedData });\n }, [propsWithDefault, setProps, autoCalculatedData]);\n\n return <Component />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import React, { useCallback, useEffect } from 'react';\nimport type { ZustandT } from './types.js';\n\nexport const AutoUpdaterComponent: ZustandT.AutoUpdaterComponentT = (props) => {\n const { usePropsStore, autoCalculatedData, propsWithDefault, Component } = props;\n const setProps = usePropsStore(useCallback((state) => state.set, []));\n\n useEffect(() => {\n setProps({ ...propsWithDefault, ...autoCalculatedData });\n }, [propsWithDefault, setProps, autoCalculatedData]);\n\n return <Component />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWd;AAXT,mBAA8C;AAGvC,MAAM,uBAAuD,CAAC,UAAU;AAC7E,QAAM,EAAE,eAAe,oBAAoB,kBAAkB,UAAU,IAAI;AAC3E,QAAM,WAAW,kBAAc,0BAAY,CAAC,UAAU,MAAM,KAAK,CAAC,CAAC,CAAC;AAEpE,8BAAU,MAAM;AACd,aAAS,EAAE,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAAA,EACzD,GAAG,CAAC,kBAAkB,UAAU,kBAAkB,CAAC;AAEnD,SAAO,4CAAC,aAAU;AACpB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/builders.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { ZustandT } from './types';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst getKeys = <T extends object>(obj: T) => Object.keys(obj) as (keyof T)[];\n\nexport const buildGetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomGetters: ZustandT.AtomGetters<A> = {} as ZustandT.AtomGetters<A>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForGetter = `get${capitalize(key as string)}` as keyof ZustandT.AtomGetters<A>;\n\n const getter = (() => get()[key]) as ZustandT.AtomGetters<A>[keyof ZustandT.AtomGetters<A>];\n\n internalAtomGetters[keyForGetter] = getter;\n });\n\n return internalAtomGetters;\n};\n\nexport const buildSetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomSetters: ZustandT.AtomSetters<A, S, R> = {} as ZustandT.AtomSetters<A, S, R>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForSetter = `set${capitalize(key as string)}` as keyof ZustandT.AtomSetters<A, S, R>;\n\n const setter = ((newVal: A[typeof key]) => {\n if (typeof newVal === 'function') {\n // If it's a function, we call it with the current store value, and the full store. We try to mimic react-setState's behavior\n set({ [key]: newVal(get()[key], get()) as A[typeof key] } as Partial<ZustandT.InternalStore<A, S, R>>);\n } else {\n // We just received the new value, set it\n set({ [key]: newVal } as Partial<ZustandT.InternalStore<A, S, R>>);\n }\n }) as ZustandT.AtomSetters<A, S, R>[keyof ZustandT.AtomSetters<A, S, R>];\n\n // We add the setter to the internalAtomSetters object\n internalAtomSetters[keyForSetter] = setter;\n });\n\n return internalAtomSetters;\n};\n\nexport const buildRefGetterAndSetter = <A extends object, S extends object, R extends object>(\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const getZustandRef = (key: string[]): HTMLElement | null => get().zustandRefs[key.join(',')];\n\n const setZustandRef = (key: string[], value: HTMLElement | null) => {\n set((state) => {\n if (state instanceof Map || state instanceof Set) return;\n const zustandRefs = state.zustandRefs;\n return {\n zustandRefs: {\n ...zustandRefs,\n [key.join(',')]: value,\n },\n };\n });\n };\n\n return [getZustandRef, setZustandRef] as const;\n};\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import type { ZustandT } from './types.js';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst getKeys = <T extends object>(obj: T) => Object.keys(obj) as (keyof T)[];\n\nexport const buildGetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomGetters: ZustandT.AtomGetters<A> = {} as ZustandT.AtomGetters<A>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForGetter = `get${capitalize(key as string)}` as keyof ZustandT.AtomGetters<A>;\n\n const getter = (() => get()[key]) as ZustandT.AtomGetters<A>[keyof ZustandT.AtomGetters<A>];\n\n internalAtomGetters[keyForGetter] = getter;\n });\n\n return internalAtomGetters;\n};\n\nexport const buildSetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomSetters: ZustandT.AtomSetters<A, S, R> = {} as ZustandT.AtomSetters<A, S, R>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForSetter = `set${capitalize(key as string)}` as keyof ZustandT.AtomSetters<A, S, R>;\n\n const setter = ((newVal: A[typeof key]) => {\n if (typeof newVal === 'function') {\n // If it's a function, we call it with the current store value, and the full store. We try to mimic react-setState's behavior\n set({ [key]: newVal(get()[key], get()) as A[typeof key] } as Partial<ZustandT.InternalStore<A, S, R>>);\n } else {\n // We just received the new value, set it\n set({ [key]: newVal } as Partial<ZustandT.InternalStore<A, S, R>>);\n }\n }) as ZustandT.AtomSetters<A, S, R>[keyof ZustandT.AtomSetters<A, S, R>];\n\n // We add the setter to the internalAtomSetters object\n internalAtomSetters[keyForSetter] = setter;\n });\n\n return internalAtomSetters;\n};\n\nexport const buildRefGetterAndSetter = <A extends object, S extends object, R extends object>(\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const getZustandRef = (key: string[]): HTMLElement | null => get().zustandRefs[key.join(',')];\n\n const setZustandRef = (key: string[], value: HTMLElement | null) => {\n set((state) => {\n if (state instanceof Map || state instanceof Set) return;\n const zustandRefs = state.zustandRefs;\n return {\n zustandRefs: {\n ...zustandRefs,\n [key.join(',')]: value,\n },\n };\n });\n };\n\n return [getZustandRef, setZustandRef] as const;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,MAAM,aAAa,CAAC,QAAgB,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,MAAM,CAAC;AAE7E,MAAM,UAAU,CAAmB,QAAW,OAAO,KAAK,GAAG;AAEtD,MAAM,eAAe,CAC1B,2BACA,QACG;AACH,QAAM,sBAA+C,CAAC;AAEtD,UAAQ,yBAAyB,EAAE,QAAQ,CAAC,QAAQ;AAClD,UAAM,eAAe,MAAM,WAAW,GAAa;AAEnD,UAAM,SAAU,MAAM,IAAI,EAAE;AAE5B,wBAAoB,gBAAgB;AAAA,EACtC,CAAC;AAED,SAAO;AACT;AAEO,MAAM,eAAe,CAC1B,2BACA,KACA,QACG;AACH,QAAM,sBAAqD,CAAC;AAE5D,UAAQ,yBAAyB,EAAE,QAAQ,CAAC,QAAQ;AAClD,UAAM,eAAe,MAAM,WAAW,GAAa;AAEnD,UAAM,SAAU,CAAC,WAA0B;AACzC,UAAI,OAAO,WAAW,YAAY;AAEhC,YAAI,EAAE,CAAC,MAAM,OAAO,IAAI,EAAE,MAAM,IAAI,CAAC,EAAmB,CAA6C;AAAA,MACvG,OAAO;AAEL,YAAI,EAAE,CAAC,MAAM,OAAO,CAA6C;AAAA,MACnE;AAAA,IACF;AAGA,wBAAoB,gBAAgB;AAAA,EACtC,CAAC;AAED,SAAO;AACT;AAEO,MAAM,0BAA0B,CACrC,KACA,QACG;AACH,QAAM,gBAAgB,CAAC,QAAsC,IAAI,EAAE,YAAY,IAAI,KAAK,GAAG;AAE3F,QAAM,gBAAgB,CAAC,KAAe,UAA8B;AAClE,QAAI,CAAC,UAAU;AACb,UAAI,iBAAiB,OAAO,iBAAiB;AAAK;AAClD,YAAM,cAAc,MAAM;AAC1B,aAAO;AAAA,QACL,aAAa;AAAA,UACX,GAAG;AAAA,UACH,CAAC,IAAI,KAAK,GAAG,IAAI;AAAA,QACnB;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,CAAC,eAAe,aAAa;AACtC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createInternalAndPropsContext.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import createContext from 'zustand/context';\nimport type { ZustandT } from './types';\n\nexport const createInternalAndPropsContext = <\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>() => {\n const { Provider: PropsProvider, useStore: usePropsStore } =\n createContext<ZustandT.ZustandStore<ZustandT.PropsStore<P & C>>>();\n\n const { Provider: InternalProvider, useStore: useInternalStore } =\n createContext<ZustandT.ZustandStore<ZustandT.InternalStore<A, S, R>>>();\n\n return { PropsProvider, usePropsStore, InternalProvider, useInternalStore };\n};\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import createContext from 'zustand/context';\nimport type { ZustandT } from './types.js';\n\nexport const createInternalAndPropsContext = <\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>() => {\n const { Provider: PropsProvider, useStore: usePropsStore } =\n createContext<ZustandT.ZustandStore<ZustandT.PropsStore<P & C>>>();\n\n const { Provider: InternalProvider, useStore: useInternalStore } =\n createContext<ZustandT.ZustandStore<ZustandT.InternalStore<A, S, R>>>();\n\n return { PropsProvider, usePropsStore, InternalProvider, useInternalStore };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAA0B;AAGnB,MAAM,gCAAgC,MAMtC;AACL,QAAM,EAAE,UAAU,eAAe,UAAU,cAAc,QACvD,eAAAA,SAAiE;AAEnE,QAAM,EAAE,UAAU,kBAAkB,UAAU,iBAAiB,QAC7D,eAAAA,SAAsE;AAExE,SAAO,EAAE,eAAe,eAAe,kBAAkB,iBAAiB;AAC5E;",
6
6
  "names": ["createContext"]
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -29,6 +29,6 @@ __export(src_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(src_exports);
31
31
  var React = __toESM(require("react"));
32
- var import_createInternalAndPropsContext = require("./createInternalAndPropsContext");
33
- var import_withZustand = require("./withZustand");
32
+ var import_createInternalAndPropsContext = require("./createInternalAndPropsContext.js");
33
+ var import_withZustand = require("./withZustand.js");
34
34
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export { createInternalAndPropsContext } from './createInternalAndPropsContext';\nexport { withZustand } from './withZustand';\nexport type { ZustandT } from './types';\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["export { createInternalAndPropsContext } from './createInternalAndPropsContext.js';\nexport { withZustand } from './withZustand.js';\nexport type { ZustandT } from './types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2CAA8C;AAC9C,yBAA4B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -32,7 +32,7 @@ var import_react = require("react");
32
32
  var import_zustand = __toESM(require("zustand"));
33
33
  var import_middleware = require("zustand/middleware");
34
34
  var import_immer = require("zustand/middleware/immer");
35
- var import_builders = require("./builders");
35
+ var import_builders = require("./builders.js");
36
36
  const createInternalStore = ({
37
37
  internalAtomDefaultValues,
38
38
  selectors,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useInternalStoreCreator.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useCallback } from 'react';\nimport create from 'zustand';\nimport { subscribeWithSelector } from 'zustand/middleware';\nimport { immer } from 'zustand/middleware/immer';\nimport { buildGetters, buildRefGetterAndSetter, buildSetters } from './builders';\nimport type { ZustandT } from './types';\n\n// Function that will create the store, putting:\n// 1) the atoms\n// 2) the getters for the atoms (which we auto-calculate and are mutable)\n// 3) the setters for the atoms (which we auto-calculate)\n// 4) the auto-calculated values\n// 5) selectors\n// 6) reducers\n// 7) ref object, getters and setters\n// 8) the get function\n// 9) the set function\n// After that, we configure the subscribers\n// The store is fully typed, and the setters are typed as well\nconst createInternalStore = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const store = create(\n subscribeWithSelector(\n immer<ZustandT.InternalStore<A, S, R>>((set, get) => {\n // We build the atom getters\n const internalAtomGetters = buildGetters(internalAtomDefaultValues, get);\n\n // We build the atom setters\n const internalAtomSetters = buildSetters(internalAtomDefaultValues, get, set);\n\n // We build an object to store references to elements\n const [getZustandRef, setZustandRef] = buildRefGetterAndSetter(get, set);\n\n return {\n ...internalAtomDefaultValues,\n ...internalAtomGetters,\n ...internalAtomSetters,\n ...selectors(get),\n ...reducers(get, set),\n zustandRefs: {},\n getZustandRef,\n setZustandRef,\n get,\n set,\n };\n }),\n ),\n );\n\n // We setup all subscribers\n subscribers(store);\n\n return store;\n};\n\nexport const useInternalStoreCreator = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const storeCreator = useCallback(\n () => createInternalStore({ internalAtomDefaultValues, selectors, reducers, subscribers }),\n [internalAtomDefaultValues, selectors, reducers, subscribers],\n );\n\n return storeCreator;\n};\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import { useCallback } from 'react';\nimport create from 'zustand';\nimport { subscribeWithSelector } from 'zustand/middleware';\nimport { immer } from 'zustand/middleware/immer';\nimport { buildGetters, buildRefGetterAndSetter, buildSetters } from './builders.js';\nimport type { ZustandT } from './types.js';\n\n// Function that will create the store, putting:\n// 1) the atoms\n// 2) the getters for the atoms (which we auto-calculate and are mutable)\n// 3) the setters for the atoms (which we auto-calculate)\n// 4) the auto-calculated values\n// 5) selectors\n// 6) reducers\n// 7) ref object, getters and setters\n// 8) the get function\n// 9) the set function\n// After that, we configure the subscribers\n// The store is fully typed, and the setters are typed as well\nconst createInternalStore = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const store = create(\n subscribeWithSelector(\n immer<ZustandT.InternalStore<A, S, R>>((set, get) => {\n // We build the atom getters\n const internalAtomGetters = buildGetters(internalAtomDefaultValues, get);\n\n // We build the atom setters\n const internalAtomSetters = buildSetters(internalAtomDefaultValues, get, set);\n\n // We build an object to store references to elements\n const [getZustandRef, setZustandRef] = buildRefGetterAndSetter(get, set);\n\n return {\n ...internalAtomDefaultValues,\n ...internalAtomGetters,\n ...internalAtomSetters,\n ...selectors(get),\n ...reducers(get, set),\n zustandRefs: {},\n getZustandRef,\n setZustandRef,\n get,\n set,\n };\n }),\n ),\n );\n\n // We setup all subscribers\n subscribers(store);\n\n return store;\n};\n\nexport const useInternalStoreCreator = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const storeCreator = useCallback(\n () => createInternalStore({ internalAtomDefaultValues, selectors, reducers, subscribers }),\n [internalAtomDefaultValues, selectors, reducers, subscribers],\n );\n\n return storeCreator;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4B;AAC5B,qBAAmB;AACnB,wBAAsC;AACtC,mBAAsB;AACtB,sBAAoE;AAepE,MAAM,sBAAsB,CAAuD;AAAA,EACjF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4C;AAC1C,QAAM,YAAQ,eAAAA;AAAA,QACZ;AAAA,UACE,oBAAuC,CAAC,KAAK,QAAQ;AAEnD,cAAM,0BAAsB,8BAAa,2BAA2B,GAAG;AAGvE,cAAM,0BAAsB,8BAAa,2BAA2B,KAAK,GAAG;AAG5E,cAAM,CAAC,eAAe,aAAa,QAAI,yCAAwB,KAAK,GAAG;AAEvE,eAAO;AAAA,UACL,GAAG;AAAA,UACH,GAAG;AAAA,UACH,GAAG;AAAA,UACH,GAAG,UAAU,GAAG;AAAA,UAChB,GAAG,SAAS,KAAK,GAAG;AAAA,UACpB,aAAa,CAAC;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAGA,cAAY,KAAK;AAEjB,SAAO;AACT;AAEO,MAAM,0BAA0B,CAAuD;AAAA,EAC5F;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4C;AAC1C,QAAM,mBAAe;AAAA,IACnB,MAAM,oBAAoB,EAAE,2BAA2B,WAAW,UAAU,YAAY,CAAC;AAAA,IACzF,CAAC,2BAA2B,WAAW,UAAU,WAAW;AAAA,EAC9D;AAEA,SAAO;AACT;",
6
6
  "names": ["create"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/usePropsStoreCreator.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useCallback } from 'react';\nimport create from 'zustand';\nimport { immer } from 'zustand/middleware/immer';\nimport type { ZustandT } from './types';\n\nconst createPropsStore = <P extends object, C extends object>(propsWithDefault: P, autoCalculatedData: C) =>\n create(\n immer<ZustandT.PropsStore<P & C>>((set) => ({\n set,\n ...propsWithDefault,\n ...autoCalculatedData,\n })),\n );\n\nexport const usePropsStoreCreator = <P extends object, C extends object>(props: P, autoCalculatedData: C) => {\n // we want to memoize the creation of the store,\n // it doesn't make sense to create a new store every time the props change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const storeCreator = useCallback(() => createPropsStore(props, autoCalculatedData), []);\n\n return storeCreator;\n};\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import { useCallback } from 'react';\nimport create from 'zustand';\nimport { immer } from 'zustand/middleware/immer';\nimport type { ZustandT } from './types.js';\n\nconst createPropsStore = <P extends object, C extends object>(propsWithDefault: P, autoCalculatedData: C) =>\n create(\n immer<ZustandT.PropsStore<P & C>>((set) => ({\n set,\n ...propsWithDefault,\n ...autoCalculatedData,\n })),\n );\n\nexport const usePropsStoreCreator = <P extends object, C extends object>(props: P, autoCalculatedData: C) => {\n // we want to memoize the creation of the store,\n // it doesn't make sense to create a new store every time the props change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const storeCreator = useCallback(() => createPropsStore(props, autoCalculatedData), []);\n\n return storeCreator;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4B;AAC5B,qBAAmB;AACnB,mBAAsB;AAGtB,MAAM,mBAAmB,CAAqC,kBAAqB,2BACjF,eAAAA;AAAA,MACE,oBAAkC,CAAC,SAAS;AAAA,IAC1C;AAAA,IACA,GAAG;AAAA,IACH,GAAG;AAAA,EACL,EAAE;AACJ;AAEK,MAAM,uBAAuB,CAAqC,OAAU,uBAA0B;AAI3G,QAAM,mBAAe,0BAAY,MAAM,iBAAiB,OAAO,kBAAkB,GAAG,CAAC,CAAC;AAEtF,SAAO;AACT;",
6
6
  "names": ["create"]
7
7
  }
@@ -29,10 +29,10 @@ __export(withZustand_exports, {
29
29
  module.exports = __toCommonJS(withZustand_exports);
30
30
  var React = __toESM(require("react"));
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
- var import_ds_utilities = require("@elliemae/ds-utilities");
33
- var import_useInternalStoreCreator = require("./useInternalStoreCreator");
34
- var import_AutoUpdaterComponent = require("./AutoUpdaterComponent");
35
- var import_usePropsStoreCreator = require("./usePropsStoreCreator");
32
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
33
+ var import_useInternalStoreCreator = require("./useInternalStoreCreator.js");
34
+ var import_AutoUpdaterComponent = require("./AutoUpdaterComponent.js");
35
+ var import_usePropsStoreCreator = require("./usePropsStoreCreator.js");
36
36
  const noopish = () => ({});
37
37
  const withZustand = (Component, config) => {
38
38
  const {
@@ -47,7 +47,7 @@ const withZustand = (Component, config) => {
47
47
  usePropsStore
48
48
  } = config;
49
49
  const ComponentWithStore = (props) => {
50
- const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, defaultProps);
50
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, defaultProps);
51
51
  const autoCalculatedData = useAutoCalculated(propsWithDefault);
52
52
  const internalStoreCreator = (0, import_useInternalStoreCreator.useInternalStoreCreator)({
53
53
  internalAtomDefaultValues,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/withZustand.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable indent */\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { useInternalStoreCreator } from './useInternalStoreCreator';\nimport type { ZustandT } from './types';\nimport { AutoUpdaterComponent } from './AutoUpdaterComponent';\nimport { usePropsStoreCreator } from './usePropsStoreCreator';\n\nconst noopish = <T extends object>() => ({} as T);\n\nexport const withZustand = <\n U extends object,\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>(\n Component: React.ComponentType<Record<string, never>>,\n config: ZustandT.Config<P, A, C, S, R>,\n) => {\n const {\n defaultProps,\n internalAtomDefaultValues,\n useAutoCalculated,\n selectors = noopish,\n reducers = noopish,\n subscribers = noopish,\n PropsProvider,\n InternalProvider,\n usePropsStore,\n } = config;\n\n const ComponentWithStore = (props: U) => {\n const propsWithDefault = useMemoMergePropsWithDefault<P>(props, defaultProps);\n\n const autoCalculatedData = useAutoCalculated(propsWithDefault);\n\n const internalStoreCreator = useInternalStoreCreator({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n });\n\n const propsStoreCreator = usePropsStoreCreator(propsWithDefault, autoCalculatedData);\n\n return (\n <PropsProvider createStore={propsStoreCreator}>\n <InternalProvider createStore={internalStoreCreator}>\n <AutoUpdaterComponent\n Component={Component}\n usePropsStore={usePropsStore}\n autoCalculatedData={autoCalculatedData}\n propsWithDefault={propsWithDefault}\n />\n </InternalProvider>\n </PropsProvider>\n );\n };\n return ComponentWithStore;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiDb;AAhDV,0BAA6C;AAC7C,qCAAwC;AAExC,kCAAqC;AACrC,kCAAqC;AAErC,MAAM,UAAU,OAAyB,CAAC;AAEnC,MAAM,cAAc,CAQzB,WACA,WACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAqB,CAAC,UAAa;AACvC,UAAM,uBAAmB,kDAAgC,OAAO,YAAY;AAE5E,UAAM,qBAAqB,kBAAkB,gBAAgB;AAE7D,UAAM,2BAAuB,wDAAwB;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,wBAAoB,kDAAqB,kBAAkB,kBAAkB;AAEnF,WACE,4CAAC,iBAAc,aAAa,mBAC1B,sDAAC,oBAAiB,aAAa,sBAC7B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF,GACF;AAAA,EAEJ;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["/* eslint-disable indent */\n\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useInternalStoreCreator } from './useInternalStoreCreator.js';\nimport type { ZustandT } from './types.js';\nimport { AutoUpdaterComponent } from './AutoUpdaterComponent.js';\nimport { usePropsStoreCreator } from './usePropsStoreCreator.js';\n\nconst noopish = <T extends object>() => ({} as T);\n\nexport const withZustand = <\n U extends object,\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>(\n Component: React.ComponentType<Record<string, never>>,\n config: ZustandT.Config<P, A, C, S, R>,\n) => {\n const {\n defaultProps,\n internalAtomDefaultValues,\n useAutoCalculated,\n selectors = noopish,\n reducers = noopish,\n subscribers = noopish,\n PropsProvider,\n InternalProvider,\n usePropsStore,\n } = config;\n\n const ComponentWithStore = (props: U) => {\n const propsWithDefault = useMemoMergePropsWithDefault<P>(props, defaultProps);\n\n const autoCalculatedData = useAutoCalculated(propsWithDefault);\n\n const internalStoreCreator = useInternalStoreCreator({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n });\n\n const propsStoreCreator = usePropsStoreCreator(propsWithDefault, autoCalculatedData);\n\n return (\n <PropsProvider createStore={propsStoreCreator}>\n <InternalProvider createStore={internalStoreCreator}>\n <AutoUpdaterComponent\n Component={Component}\n usePropsStore={usePropsStore}\n autoCalculatedData={autoCalculatedData}\n propsWithDefault={propsWithDefault}\n />\n </InternalProvider>\n </PropsProvider>\n );\n };\n return ComponentWithStore;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkDb;AAhDV,8BAA6C;AAC7C,qCAAwC;AAExC,kCAAqC;AACrC,kCAAqC;AAErC,MAAM,UAAU,OAAyB,CAAC;AAEnC,MAAM,cAAc,CAQzB,WACA,WACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAqB,CAAC,UAAa;AACvC,UAAM,uBAAmB,sDAAgC,OAAO,YAAY;AAE5E,UAAM,qBAAqB,kBAAkB,gBAAgB;AAE7D,UAAM,2BAAuB,wDAAwB;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,wBAAoB,kDAAqB,kBAAkB,kBAAkB;AAEnF,WACE,4CAAC,iBAAc,aAAa,mBAC1B,sDAAC,oBAAiB,aAAa,sBAC7B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF,GACF;AAAA,EAEJ;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/AutoUpdaterComponent.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useEffect } from 'react';\nimport type { ZustandT } from './types';\n\nexport const AutoUpdaterComponent: ZustandT.AutoUpdaterComponentT = (props) => {\n const { usePropsStore, autoCalculatedData, propsWithDefault, Component } = props;\n const setProps = usePropsStore(useCallback((state) => state.set, []));\n\n useEffect(() => {\n setProps({ ...propsWithDefault, ...autoCalculatedData });\n }, [propsWithDefault, setProps, autoCalculatedData]);\n\n return <Component />;\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useEffect } from 'react';\nimport type { ZustandT } from './types.js';\n\nexport const AutoUpdaterComponent: ZustandT.AutoUpdaterComponentT = (props) => {\n const { usePropsStore, autoCalculatedData, propsWithDefault, Component } = props;\n const setProps = usePropsStore(useCallback((state) => state.set, []));\n\n useEffect(() => {\n setProps({ ...propsWithDefault, ...autoCalculatedData });\n }, [propsWithDefault, setProps, autoCalculatedData]);\n\n return <Component />;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACWd;AAXT,SAAgB,aAAa,iBAAiB;AAGvC,MAAM,uBAAuD,CAAC,UAAU;AAC7E,QAAM,EAAE,eAAe,oBAAoB,kBAAkB,UAAU,IAAI;AAC3E,QAAM,WAAW,cAAc,YAAY,CAAC,UAAU,MAAM,KAAK,CAAC,CAAC,CAAC;AAEpE,YAAU,MAAM;AACd,aAAS,EAAE,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAAA,EACzD,GAAG,CAAC,kBAAkB,UAAU,kBAAkB,CAAC;AAEnD,SAAO,oBAAC,aAAU;AACpB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/builders.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { ZustandT } from './types';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst getKeys = <T extends object>(obj: T) => Object.keys(obj) as (keyof T)[];\n\nexport const buildGetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomGetters: ZustandT.AtomGetters<A> = {} as ZustandT.AtomGetters<A>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForGetter = `get${capitalize(key as string)}` as keyof ZustandT.AtomGetters<A>;\n\n const getter = (() => get()[key]) as ZustandT.AtomGetters<A>[keyof ZustandT.AtomGetters<A>];\n\n internalAtomGetters[keyForGetter] = getter;\n });\n\n return internalAtomGetters;\n};\n\nexport const buildSetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomSetters: ZustandT.AtomSetters<A, S, R> = {} as ZustandT.AtomSetters<A, S, R>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForSetter = `set${capitalize(key as string)}` as keyof ZustandT.AtomSetters<A, S, R>;\n\n const setter = ((newVal: A[typeof key]) => {\n if (typeof newVal === 'function') {\n // If it's a function, we call it with the current store value, and the full store. We try to mimic react-setState's behavior\n set({ [key]: newVal(get()[key], get()) as A[typeof key] } as Partial<ZustandT.InternalStore<A, S, R>>);\n } else {\n // We just received the new value, set it\n set({ [key]: newVal } as Partial<ZustandT.InternalStore<A, S, R>>);\n }\n }) as ZustandT.AtomSetters<A, S, R>[keyof ZustandT.AtomSetters<A, S, R>];\n\n // We add the setter to the internalAtomSetters object\n internalAtomSetters[keyForSetter] = setter;\n });\n\n return internalAtomSetters;\n};\n\nexport const buildRefGetterAndSetter = <A extends object, S extends object, R extends object>(\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const getZustandRef = (key: string[]): HTMLElement | null => get().zustandRefs[key.join(',')];\n\n const setZustandRef = (key: string[], value: HTMLElement | null) => {\n set((state) => {\n if (state instanceof Map || state instanceof Set) return;\n const zustandRefs = state.zustandRefs;\n return {\n zustandRefs: {\n ...zustandRefs,\n [key.join(',')]: value,\n },\n };\n });\n };\n\n return [getZustandRef, setZustandRef] as const;\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { ZustandT } from './types.js';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst getKeys = <T extends object>(obj: T) => Object.keys(obj) as (keyof T)[];\n\nexport const buildGetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomGetters: ZustandT.AtomGetters<A> = {} as ZustandT.AtomGetters<A>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForGetter = `get${capitalize(key as string)}` as keyof ZustandT.AtomGetters<A>;\n\n const getter = (() => get()[key]) as ZustandT.AtomGetters<A>[keyof ZustandT.AtomGetters<A>];\n\n internalAtomGetters[keyForGetter] = getter;\n });\n\n return internalAtomGetters;\n};\n\nexport const buildSetters = <A extends object, S extends object, R extends object>(\n internalAtomDefaultValues: A,\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const internalAtomSetters: ZustandT.AtomSetters<A, S, R> = {} as ZustandT.AtomSetters<A, S, R>;\n\n getKeys(internalAtomDefaultValues).forEach((key) => {\n const keyForSetter = `set${capitalize(key as string)}` as keyof ZustandT.AtomSetters<A, S, R>;\n\n const setter = ((newVal: A[typeof key]) => {\n if (typeof newVal === 'function') {\n // If it's a function, we call it with the current store value, and the full store. We try to mimic react-setState's behavior\n set({ [key]: newVal(get()[key], get()) as A[typeof key] } as Partial<ZustandT.InternalStore<A, S, R>>);\n } else {\n // We just received the new value, set it\n set({ [key]: newVal } as Partial<ZustandT.InternalStore<A, S, R>>);\n }\n }) as ZustandT.AtomSetters<A, S, R>[keyof ZustandT.AtomSetters<A, S, R>];\n\n // We add the setter to the internalAtomSetters object\n internalAtomSetters[keyForSetter] = setter;\n });\n\n return internalAtomSetters;\n};\n\nexport const buildRefGetterAndSetter = <A extends object, S extends object, R extends object>(\n get: ZustandT.Getter<ZustandT.InternalStore<A, S, R>>,\n set: ZustandT.Setter<ZustandT.InternalStore<A, S, R>>,\n) => {\n const getZustandRef = (key: string[]): HTMLElement | null => get().zustandRefs[key.join(',')];\n\n const setZustandRef = (key: string[], value: HTMLElement | null) => {\n set((state) => {\n if (state instanceof Map || state instanceof Set) return;\n const zustandRefs = state.zustandRefs;\n return {\n zustandRefs: {\n ...zustandRefs,\n [key.join(',')]: value,\n },\n };\n });\n };\n\n return [getZustandRef, setZustandRef] as const;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,aAAa,CAAC,QAAgB,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,MAAM,CAAC;AAE7E,MAAM,UAAU,CAAmB,QAAW,OAAO,KAAK,GAAG;AAEtD,MAAM,eAAe,CAC1B,2BACA,QACG;AACH,QAAM,sBAA+C,CAAC;AAEtD,UAAQ,yBAAyB,EAAE,QAAQ,CAAC,QAAQ;AAClD,UAAM,eAAe,MAAM,WAAW,GAAa;AAEnD,UAAM,SAAU,MAAM,IAAI,EAAE;AAE5B,wBAAoB,gBAAgB;AAAA,EACtC,CAAC;AAED,SAAO;AACT;AAEO,MAAM,eAAe,CAC1B,2BACA,KACA,QACG;AACH,QAAM,sBAAqD,CAAC;AAE5D,UAAQ,yBAAyB,EAAE,QAAQ,CAAC,QAAQ;AAClD,UAAM,eAAe,MAAM,WAAW,GAAa;AAEnD,UAAM,SAAU,CAAC,WAA0B;AACzC,UAAI,OAAO,WAAW,YAAY;AAEhC,YAAI,EAAE,CAAC,MAAM,OAAO,IAAI,EAAE,MAAM,IAAI,CAAC,EAAmB,CAA6C;AAAA,MACvG,OAAO;AAEL,YAAI,EAAE,CAAC,MAAM,OAAO,CAA6C;AAAA,MACnE;AAAA,IACF;AAGA,wBAAoB,gBAAgB;AAAA,EACtC,CAAC;AAED,SAAO;AACT;AAEO,MAAM,0BAA0B,CACrC,KACA,QACG;AACH,QAAM,gBAAgB,CAAC,QAAsC,IAAI,EAAE,YAAY,IAAI,KAAK,GAAG;AAE3F,QAAM,gBAAgB,CAAC,KAAe,UAA8B;AAClE,QAAI,CAAC,UAAU;AACb,UAAI,iBAAiB,OAAO,iBAAiB;AAAK;AAClD,YAAM,cAAc,MAAM;AAC1B,aAAO;AAAA,QACL,aAAa;AAAA,UACX,GAAG;AAAA,UACH,CAAC,IAAI,KAAK,GAAG,IAAI;AAAA,QACnB;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,CAAC,eAAe,aAAa;AACtC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/createInternalAndPropsContext.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import createContext from 'zustand/context';\nimport type { ZustandT } from './types';\n\nexport const createInternalAndPropsContext = <\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>() => {\n const { Provider: PropsProvider, useStore: usePropsStore } =\n createContext<ZustandT.ZustandStore<ZustandT.PropsStore<P & C>>>();\n\n const { Provider: InternalProvider, useStore: useInternalStore } =\n createContext<ZustandT.ZustandStore<ZustandT.InternalStore<A, S, R>>>();\n\n return { PropsProvider, usePropsStore, InternalProvider, useInternalStore };\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import createContext from 'zustand/context';\nimport type { ZustandT } from './types.js';\n\nexport const createInternalAndPropsContext = <\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>() => {\n const { Provider: PropsProvider, useStore: usePropsStore } =\n createContext<ZustandT.ZustandStore<ZustandT.PropsStore<P & C>>>();\n\n const { Provider: InternalProvider, useStore: useInternalStore } =\n createContext<ZustandT.ZustandStore<ZustandT.InternalStore<A, S, R>>>();\n\n return { PropsProvider, usePropsStore, InternalProvider, useInternalStore };\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,mBAAmB;AAGnB,MAAM,gCAAgC,MAMtC;AACL,QAAM,EAAE,UAAU,eAAe,UAAU,cAAc,IACvD,cAAiE;AAEnE,QAAM,EAAE,UAAU,kBAAkB,UAAU,iBAAiB,IAC7D,cAAsE;AAExE,SAAO,EAAE,eAAe,eAAe,kBAAkB,iBAAiB;AAC5E;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { createInternalAndPropsContext } from "./createInternalAndPropsContext";
3
- import { withZustand } from "./withZustand";
2
+ import { createInternalAndPropsContext } from "./createInternalAndPropsContext.js";
3
+ import { withZustand } from "./withZustand.js";
4
4
  export {
5
5
  createInternalAndPropsContext,
6
6
  withZustand
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { createInternalAndPropsContext } from './createInternalAndPropsContext';\nexport { withZustand } from './withZustand';\nexport type { ZustandT } from './types';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { createInternalAndPropsContext } from './createInternalAndPropsContext.js';\nexport { withZustand } from './withZustand.js';\nexport type { ZustandT } from './types.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qCAAqC;AAC9C,SAAS,mBAAmB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -3,7 +3,7 @@ import { useCallback } from "react";
3
3
  import create from "zustand";
4
4
  import { subscribeWithSelector } from "zustand/middleware";
5
5
  import { immer } from "zustand/middleware/immer";
6
- import { buildGetters, buildRefGetterAndSetter, buildSetters } from "./builders";
6
+ import { buildGetters, buildRefGetterAndSetter, buildSetters } from "./builders.js";
7
7
  const createInternalStore = ({
8
8
  internalAtomDefaultValues,
9
9
  selectors,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/useInternalStoreCreator.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback } from 'react';\nimport create from 'zustand';\nimport { subscribeWithSelector } from 'zustand/middleware';\nimport { immer } from 'zustand/middleware/immer';\nimport { buildGetters, buildRefGetterAndSetter, buildSetters } from './builders';\nimport type { ZustandT } from './types';\n\n// Function that will create the store, putting:\n// 1) the atoms\n// 2) the getters for the atoms (which we auto-calculate and are mutable)\n// 3) the setters for the atoms (which we auto-calculate)\n// 4) the auto-calculated values\n// 5) selectors\n// 6) reducers\n// 7) ref object, getters and setters\n// 8) the get function\n// 9) the set function\n// After that, we configure the subscribers\n// The store is fully typed, and the setters are typed as well\nconst createInternalStore = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const store = create(\n subscribeWithSelector(\n immer<ZustandT.InternalStore<A, S, R>>((set, get) => {\n // We build the atom getters\n const internalAtomGetters = buildGetters(internalAtomDefaultValues, get);\n\n // We build the atom setters\n const internalAtomSetters = buildSetters(internalAtomDefaultValues, get, set);\n\n // We build an object to store references to elements\n const [getZustandRef, setZustandRef] = buildRefGetterAndSetter(get, set);\n\n return {\n ...internalAtomDefaultValues,\n ...internalAtomGetters,\n ...internalAtomSetters,\n ...selectors(get),\n ...reducers(get, set),\n zustandRefs: {},\n getZustandRef,\n setZustandRef,\n get,\n set,\n };\n }),\n ),\n );\n\n // We setup all subscribers\n subscribers(store);\n\n return store;\n};\n\nexport const useInternalStoreCreator = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const storeCreator = useCallback(\n () => createInternalStore({ internalAtomDefaultValues, selectors, reducers, subscribers }),\n [internalAtomDefaultValues, selectors, reducers, subscribers],\n );\n\n return storeCreator;\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback } from 'react';\nimport create from 'zustand';\nimport { subscribeWithSelector } from 'zustand/middleware';\nimport { immer } from 'zustand/middleware/immer';\nimport { buildGetters, buildRefGetterAndSetter, buildSetters } from './builders.js';\nimport type { ZustandT } from './types.js';\n\n// Function that will create the store, putting:\n// 1) the atoms\n// 2) the getters for the atoms (which we auto-calculate and are mutable)\n// 3) the setters for the atoms (which we auto-calculate)\n// 4) the auto-calculated values\n// 5) selectors\n// 6) reducers\n// 7) ref object, getters and setters\n// 8) the get function\n// 9) the set function\n// After that, we configure the subscribers\n// The store is fully typed, and the setters are typed as well\nconst createInternalStore = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const store = create(\n subscribeWithSelector(\n immer<ZustandT.InternalStore<A, S, R>>((set, get) => {\n // We build the atom getters\n const internalAtomGetters = buildGetters(internalAtomDefaultValues, get);\n\n // We build the atom setters\n const internalAtomSetters = buildSetters(internalAtomDefaultValues, get, set);\n\n // We build an object to store references to elements\n const [getZustandRef, setZustandRef] = buildRefGetterAndSetter(get, set);\n\n return {\n ...internalAtomDefaultValues,\n ...internalAtomGetters,\n ...internalAtomSetters,\n ...selectors(get),\n ...reducers(get, set),\n zustandRefs: {},\n getZustandRef,\n setZustandRef,\n get,\n set,\n };\n }),\n ),\n );\n\n // We setup all subscribers\n subscribers(store);\n\n return store;\n};\n\nexport const useInternalStoreCreator = <A extends object, S extends object, R extends object>({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n}: ZustandT.InternalParameters<A, S, R>) => {\n const storeCreator = useCallback(\n () => createInternalStore({ internalAtomDefaultValues, selectors, reducers, subscribers }),\n [internalAtomDefaultValues, selectors, reducers, subscribers],\n );\n\n return storeCreator;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,mBAAmB;AAC5B,OAAO,YAAY;AACnB,SAAS,6BAA6B;AACtC,SAAS,aAAa;AACtB,SAAS,cAAc,yBAAyB,oBAAoB;AAepE,MAAM,sBAAsB,CAAuD;AAAA,EACjF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4C;AAC1C,QAAM,QAAQ;AAAA,IACZ;AAAA,MACE,MAAuC,CAAC,KAAK,QAAQ;AAEnD,cAAM,sBAAsB,aAAa,2BAA2B,GAAG;AAGvE,cAAM,sBAAsB,aAAa,2BAA2B,KAAK,GAAG;AAG5E,cAAM,CAAC,eAAe,aAAa,IAAI,wBAAwB,KAAK,GAAG;AAEvE,eAAO;AAAA,UACL,GAAG;AAAA,UACH,GAAG;AAAA,UACH,GAAG;AAAA,UACH,GAAG,UAAU,GAAG;AAAA,UAChB,GAAG,SAAS,KAAK,GAAG;AAAA,UACpB,aAAa,CAAC;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAGA,cAAY,KAAK;AAEjB,SAAO;AACT;AAEO,MAAM,0BAA0B,CAAuD;AAAA,EAC5F;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4C;AAC1C,QAAM,eAAe;AAAA,IACnB,MAAM,oBAAoB,EAAE,2BAA2B,WAAW,UAAU,YAAY,CAAC;AAAA,IACzF,CAAC,2BAA2B,WAAW,UAAU,WAAW;AAAA,EAC9D;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/usePropsStoreCreator.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback } from 'react';\nimport create from 'zustand';\nimport { immer } from 'zustand/middleware/immer';\nimport type { ZustandT } from './types';\n\nconst createPropsStore = <P extends object, C extends object>(propsWithDefault: P, autoCalculatedData: C) =>\n create(\n immer<ZustandT.PropsStore<P & C>>((set) => ({\n set,\n ...propsWithDefault,\n ...autoCalculatedData,\n })),\n );\n\nexport const usePropsStoreCreator = <P extends object, C extends object>(props: P, autoCalculatedData: C) => {\n // we want to memoize the creation of the store,\n // it doesn't make sense to create a new store every time the props change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const storeCreator = useCallback(() => createPropsStore(props, autoCalculatedData), []);\n\n return storeCreator;\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback } from 'react';\nimport create from 'zustand';\nimport { immer } from 'zustand/middleware/immer';\nimport type { ZustandT } from './types.js';\n\nconst createPropsStore = <P extends object, C extends object>(propsWithDefault: P, autoCalculatedData: C) =>\n create(\n immer<ZustandT.PropsStore<P & C>>((set) => ({\n set,\n ...propsWithDefault,\n ...autoCalculatedData,\n })),\n );\n\nexport const usePropsStoreCreator = <P extends object, C extends object>(props: P, autoCalculatedData: C) => {\n // we want to memoize the creation of the store,\n // it doesn't make sense to create a new store every time the props change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const storeCreator = useCallback(() => createPropsStore(props, autoCalculatedData), []);\n\n return storeCreator;\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,mBAAmB;AAC5B,OAAO,YAAY;AACnB,SAAS,aAAa;AAGtB,MAAM,mBAAmB,CAAqC,kBAAqB,uBACjF;AAAA,EACE,MAAkC,CAAC,SAAS;AAAA,IAC1C;AAAA,IACA,GAAG;AAAA,IACH,GAAG;AAAA,EACL,EAAE;AACJ;AAEK,MAAM,uBAAuB,CAAqC,OAAU,uBAA0B;AAI3G,QAAM,eAAe,YAAY,MAAM,iBAAiB,OAAO,kBAAkB,GAAG,CAAC,CAAC;AAEtF,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useMemoMergePropsWithDefault } from "@elliemae/ds-utilities";
4
- import { useInternalStoreCreator } from "./useInternalStoreCreator";
5
- import { AutoUpdaterComponent } from "./AutoUpdaterComponent";
6
- import { usePropsStoreCreator } from "./usePropsStoreCreator";
3
+ import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
4
+ import { useInternalStoreCreator } from "./useInternalStoreCreator.js";
5
+ import { AutoUpdaterComponent } from "./AutoUpdaterComponent.js";
6
+ import { usePropsStoreCreator } from "./usePropsStoreCreator.js";
7
7
  const noopish = () => ({});
8
8
  const withZustand = (Component, config) => {
9
9
  const {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/withZustand.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { useInternalStoreCreator } from './useInternalStoreCreator';\nimport type { ZustandT } from './types';\nimport { AutoUpdaterComponent } from './AutoUpdaterComponent';\nimport { usePropsStoreCreator } from './usePropsStoreCreator';\n\nconst noopish = <T extends object>() => ({} as T);\n\nexport const withZustand = <\n U extends object,\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>(\n Component: React.ComponentType<Record<string, never>>,\n config: ZustandT.Config<P, A, C, S, R>,\n) => {\n const {\n defaultProps,\n internalAtomDefaultValues,\n useAutoCalculated,\n selectors = noopish,\n reducers = noopish,\n subscribers = noopish,\n PropsProvider,\n InternalProvider,\n usePropsStore,\n } = config;\n\n const ComponentWithStore = (props: U) => {\n const propsWithDefault = useMemoMergePropsWithDefault<P>(props, defaultProps);\n\n const autoCalculatedData = useAutoCalculated(propsWithDefault);\n\n const internalStoreCreator = useInternalStoreCreator({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n });\n\n const propsStoreCreator = usePropsStoreCreator(propsWithDefault, autoCalculatedData);\n\n return (\n <PropsProvider createStore={propsStoreCreator}>\n <InternalProvider createStore={internalStoreCreator}>\n <AutoUpdaterComponent\n Component={Component}\n usePropsStore={usePropsStore}\n autoCalculatedData={autoCalculatedData}\n propsWithDefault={propsWithDefault}\n />\n </InternalProvider>\n </PropsProvider>\n );\n };\n return ComponentWithStore;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACiDb;AAhDV,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AAExC,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AAErC,MAAM,UAAU,OAAyB,CAAC;AAEnC,MAAM,cAAc,CAQzB,WACA,WACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAqB,CAAC,UAAa;AACvC,UAAM,mBAAmB,6BAAgC,OAAO,YAAY;AAE5E,UAAM,qBAAqB,kBAAkB,gBAAgB;AAE7D,UAAM,uBAAuB,wBAAwB;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,oBAAoB,qBAAqB,kBAAkB,kBAAkB;AAEnF,WACE,oBAAC,iBAAc,aAAa,mBAC1B,8BAAC,oBAAiB,aAAa,sBAC7B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF,GACF;AAAA,EAEJ;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useInternalStoreCreator } from './useInternalStoreCreator.js';\nimport type { ZustandT } from './types.js';\nimport { AutoUpdaterComponent } from './AutoUpdaterComponent.js';\nimport { usePropsStoreCreator } from './usePropsStoreCreator.js';\n\nconst noopish = <T extends object>() => ({} as T);\n\nexport const withZustand = <\n U extends object,\n P extends object,\n A extends object,\n C extends object,\n S extends object,\n R extends object,\n>(\n Component: React.ComponentType<Record<string, never>>,\n config: ZustandT.Config<P, A, C, S, R>,\n) => {\n const {\n defaultProps,\n internalAtomDefaultValues,\n useAutoCalculated,\n selectors = noopish,\n reducers = noopish,\n subscribers = noopish,\n PropsProvider,\n InternalProvider,\n usePropsStore,\n } = config;\n\n const ComponentWithStore = (props: U) => {\n const propsWithDefault = useMemoMergePropsWithDefault<P>(props, defaultProps);\n\n const autoCalculatedData = useAutoCalculated(propsWithDefault);\n\n const internalStoreCreator = useInternalStoreCreator({\n internalAtomDefaultValues,\n selectors,\n reducers,\n subscribers,\n });\n\n const propsStoreCreator = usePropsStoreCreator(propsWithDefault, autoCalculatedData);\n\n return (\n <PropsProvider createStore={propsStoreCreator}>\n <InternalProvider createStore={internalStoreCreator}>\n <AutoUpdaterComponent\n Component={Component}\n usePropsStore={usePropsStore}\n autoCalculatedData={autoCalculatedData}\n propsWithDefault={propsWithDefault}\n />\n </InternalProvider>\n </PropsProvider>\n );\n };\n return ComponentWithStore;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkDb;AAhDV,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AAExC,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AAErC,MAAM,UAAU,OAAyB,CAAC;AAEnC,MAAM,cAAc,CAQzB,WACA,WACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAqB,CAAC,UAAa;AACvC,UAAM,mBAAmB,6BAAgC,OAAO,YAAY;AAE5E,UAAM,qBAAqB,kBAAkB,gBAAgB;AAE7D,UAAM,uBAAuB,wBAAwB;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,oBAAoB,qBAAqB,kBAAkB,kBAAkB;AAEnF,WACE,oBAAC,iBAAc,aAAa,mBAC1B,8BAAC,oBAAiB,aAAa,sBAC7B;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF,GACF;AAAA,EAEJ;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- import type { ZustandT } from './types';
1
+ import type { ZustandT } from './types.js';
2
2
  export declare const AutoUpdaterComponent: ZustandT.AutoUpdaterComponentT;
@@ -1,4 +1,4 @@
1
- import type { ZustandT } from './types';
1
+ import type { ZustandT } from './types.js';
2
2
  export declare const buildGetters: <A extends object, S extends object, R extends object>(internalAtomDefaultValues: A, get: () => ZustandT.InternalStore<A, S, R>) => ZustandT.AtomGetters<A>;
3
3
  export declare const buildSetters: <A extends object, S extends object, R extends object>(internalAtomDefaultValues: A, get: () => ZustandT.InternalStore<A, S, R>, set: (nextStateOrUpdater: ZustandT.InternalStore<A, S, R> | Partial<ZustandT.InternalStore<A, S, R>> | ((state: import("immer").Draft<ZustandT.InternalStore<A, S, R>>) => void), shouldReplace?: boolean | undefined) => void) => ZustandT.AtomSetters<A, S, R>;
4
4
  export declare const buildRefGetterAndSetter: <A extends object, S extends object, R extends object>(get: () => ZustandT.InternalStore<A, S, R>, set: (nextStateOrUpdater: ZustandT.InternalStore<A, S, R> | Partial<ZustandT.InternalStore<A, S, R>> | ((state: import("immer").Draft<ZustandT.InternalStore<A, S, R>>) => void), shouldReplace?: boolean | undefined) => void) => readonly [(key: string[]) => HTMLElement | null, (key: string[], value: HTMLElement | null) => void];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { ZustandT } from './types';
2
+ import type { ZustandT } from './types.js';
3
3
  export declare const createInternalAndPropsContext: <P extends object, A extends object, C extends object, S extends object, R extends object>() => {
4
4
  PropsProvider: ({ createStore, children, }: {
5
5
  createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<P & C>>;
@@ -1,3 +1,3 @@
1
- export { createInternalAndPropsContext } from './createInternalAndPropsContext';
2
- export { withZustand } from './withZustand';
3
- export type { ZustandT } from './types';
1
+ export { createInternalAndPropsContext } from './createInternalAndPropsContext.js';
2
+ export { withZustand } from './withZustand.js';
3
+ export type { ZustandT } from './types.js';
@@ -1,4 +1,4 @@
1
- import type { ZustandT } from './types';
1
+ import type { ZustandT } from './types.js';
2
2
  export declare const useInternalStoreCreator: <A extends object, S extends object, R extends object>({ internalAtomDefaultValues, selectors, reducers, subscribers, }: ZustandT.InternalParameters<A, S, R>) => () => import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<ZustandT.InternalStore<A, S, R>>, "subscribe"> & {
3
3
  subscribe: {
4
4
  (listener: (selectedState: ZustandT.InternalStore<A, S, R>, previousSelectedState: ZustandT.InternalStore<A, S, R>) => void): () => void;
@@ -1,4 +1,4 @@
1
- import type { ZustandT } from './types';
1
+ import type { ZustandT } from './types.js';
2
2
  export declare const usePropsStoreCreator: <P extends object, C extends object>(props: P, autoCalculatedData: C) => () => import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ZustandT.PropsStore<P & C>>, "setState"> & {
3
3
  setState(nextStateOrUpdater: ZustandT.PropsStore<P & C> | Partial<ZustandT.PropsStore<P & C>> | ((state: import("immer").Draft<ZustandT.PropsStore<P & C>>) => void), shouldReplace?: boolean | undefined): void;
4
4
  }>;
@@ -1,2 +1,2 @@
1
- import type { ZustandT } from './types';
1
+ import type { ZustandT } from './types.js';
2
2
  export declare const withZustand: <U extends object, P extends object, A extends object, C extends object, S extends object, R extends object>(Component: React.ComponentType<Record<string, never>>, config: ZustandT.Config<P, A, C, S, R>) => (props: U) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-zustand-helpers",
3
- "version": "3.15.0",
3
+ "version": "3.16.0-next.10",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Zustand Helpers",
6
6
  "files": [
@@ -41,7 +41,8 @@
41
41
  "dependencies": {
42
42
  "immer": "9.0.19",
43
43
  "zustand": "4.1.4",
44
- "@elliemae/ds-utilities": "3.15.0"
44
+ "@elliemae/ds-props-helpers": "3.16.0-next.10",
45
+ "@elliemae/ds-utilities": "3.16.0-next.10"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@testing-library/jest-dom": "~5.16.5",
@@ -57,7 +58,7 @@
57
58
  "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
58
59
  "dts": "node ../../scripts/dts.mjs",
59
60
  "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
60
- "dev:build": "pnpm --filter {.}... build && pnpm --filter {.}... dts",
61
+ "dev:build": "pnpm --filter {.}... build",
61
62
  "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
62
63
  "checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\"",
63
64
  "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch"