orchestore 0.1.0 → 0.1.2

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.cjs CHANGED
@@ -1,32 +1,22 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- test: () => test
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
- function test() {
27
- console.log("Working");
28
- }
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- test
32
- });
1
+ "use strict";var ee=Object.create;var R=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var ie=(e,t)=>{for(var r in t)R(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of re(t))!ne.call(e,o)&&o!==r&&R(e,o,{get:()=>t[o],enumerable:!(n=te(t,o))||n.enumerable});return e};var se=(e,t,r)=>(r=e!=null?ee(oe(e)):{},z(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e)),ae=e=>z(R({},"__esModule",{value:!0}),e);var ve={};ie(ve,{StoreProvider:()=>G,configureDiagnostics:()=>U,createSlice:()=>L,createStore:()=>k,default:()=>xe,getGlobalUtils:()=>y,provideGlobalUtils:()=>q});module.exports=ae(ve);var Q=require("@reduxjs/toolkit");var E=require("@reduxjs/toolkit"),_=require("react-redux");var g={target:({slice:e})=>e?` Affected slice '${e}':
2
+ `:" ",RequiredName:e=>`[OrcheStore::${e.module}]${g.target(e)}${e.type} keys must be non-empty strings.`,InvalidName:(e,t)=>`[OrcheStore::${e.module}]${g.target(e)}${e.type} names cannot contain '.' or '/'. Received: ${t}.`,ReservedKey:(e,t)=>`[OrcheStore::${e.module}]${g.target(e)}'${t}' is a reserved name and cannot be used as a ${e.type} key.`,DuplicateKey:(e,t)=>`[OrcheStore::${e.module}]${g.target(e)}${e.type} name '${t}' conflicts with another member.`},F=(e,t)=>{if(e)if(t==="warn")console.warn(e);else if(t==="error")console.error(e);else throw new Error(e);else return!1},D=(e,t="",r="",n)=>typeof e!="string"||!e?!!F(t,n?.[0]):e.includes(".")||e.includes("/")?!!F(r,n?.[1]):!0,ce=(e,t,r)=>{let[n,o]=[g.RequiredName(e),g.InvalidName(e,t)];if(D(t,n,o,["error","error"])){if(r[0].includes(t))return console.error(g.ReservedKey(e,t));if(r[1].includes(t))return console.error(g.DuplicateKey(e,t))}else return;return!0},C=(e,t,r,n)=>(Object.entries(t).forEach(([o,c])=>{let s=ce(e,o,r)?n(o,c):void 0;if(s===void 0)return delete t[o];t[o]=s,r[1].push(o)}),t);var x="all",$={diagnostics:!1,prerelease:!1},J=globalThis.console?.log?.bind?.(globalThis.console)||globalThis.console?.log,le=globalThis.console?.warn?.bind?.(globalThis.console)||globalThis.console?.warn,de=globalThis.console?.error?.bind?.(globalThis.console)||globalThis.console?.error,ue=globalThis.console?.clear?.bind?.(globalThis.console)||globalThis.console?.clear;globalThis.console?.clear&&(globalThis.console.clear=(...e)=>{$.diagnostics=!1,ue?.(...e)});var pe=`[OrcheStore] \u{1F6A7} Pre-release Notice
3
+ Thank you for your interest in OrcheStore.
4
+ OrcheStore is currently under active development and is not yet ready for production use.
5
+ APIs, behavior, and internal implementation details may change without notice.
6
+ The first stable release is currently planned for 2026-06-30.
7
+ Stay tuned for updates!
8
+ `,fe=`[OrcheStore] Diagnostics are enabled.
9
+ OrcheStore may emit warnings and errors to help identify incorrect usage, invalid configurations, and potential runtime issues.
10
+ Runtime exceptions that stop code execution may still occur regardless of diagnostics settings.
11
+ Please resolve all OrcheStore warnings and errors before deploying to production.
12
+ Diagnostics can be configured with configureDiagnostics("off" | "errors" | "all").
13
+ `,i={inform(e){$[e]||($[e]=!0,x==="all"&&J?.(e==="prerelease"?pe:fe))},log(...e){x==="all"&&(i.inform("diagnostics"),J?.(...e))},warn(...e){x==="all"&&(i.inform("diagnostics"),le?.(...e))},error(...e){x!=="off"&&(i.inform("diagnostics"),de?.(...e))}};function U(e){x=e}var v=se(require("react"),1),P=require("react-redux");var I=[];function V(e){let t=I.find(r=>r.store===e);if(t)return t.dispatch;throw new Error("[OrcheStore] Using OrcheStore requires wrapping your application with <StoreProvider>.")}function me({store:e,children:t}){let r=(0,P.useDispatch)(),n=I.find(o=>o.store===e);return n||I.push(n={store:e,dispatch:r}),n.dispatch=r,v.default.createElement(v.default.Fragment,null,t)}function G(e){let{store:t,stabilityCheck:r,identityFunctionCheck:n}={...e||{}},o=M(t);if(!o)throw new Error("[OrcheStore::context] <StoreProvider> requires a store instance created with createStore(...).");return v.default.createElement(P.Provider,{stabilityCheck:r,identityFunctionCheck:n,store:o},v.default.createElement(me,{...e}))}var he=Object.assign,A=Object.getOwnPropertyDescriptor(Object,"defineProperty")?.value||Object.defineProperty,ge=(e,t,r)=>{A(e,t,{get:r,enumerable:!0,configurable:!1})},Se=(e,t,r)=>{A(e,t,{value:r,writable:!1,enumerable:!0,configurable:!1})},m={assign:he,defineProp:A,defineReadonly:ge,defineMethod:Se},W={isArray:Array.isArray},T={get:Reflect.get,set:Reflect.set,delete:Reflect.deleteProperty};var w={GetMissingProp:e=>["[OrcheStore::global-utils] Attempted to access a global utility before it became available. Missing property",e,`
14
+ If this utility is optional, register it as undefined using provideGlobalUtils(...) to suppress future warnings.
15
+ `],DeleteProp:e=>["[OrcheStore::global-utils] Avoid deleting properties. Trying to delete property",e,`
16
+ Use provideGlobalUtils(...) to set them to undefined instead for type safety.
17
+ `],InvalidArgs:"[OrcheStore::global-utils] Expected provideGlobalUtils(...) to receive a non-null object. Received:"},K=new Proxy({},{get(e,t,r){return t in e||i.error(...w.GetMissingProp(t)),T.get(e,t,r)},set(e,t,r,n){return T.set(e,t,r,n)},deleteProperty(e,t){return i.warn(...w.DeleteProp(t)),T.delete(e,t)}});function y(){return K}function q(e){return e==null?i.error(w.InvalidArgs,e):W.isArray(e)?i.error(w.InvalidArgs,"(type: array)",e):typeof e!="object"?i.error(w.InvalidArgs,`(type: ${typeof e})`,e):m.assign(K,e),K}function b(e,t){let r={};return Object.keys(e).filter(o=>o.startsWith(t)).map(o=>o.split(".")).sort((o,c)=>o.length-c.length).forEach(o=>{let c=r;o.slice(0,o.length-1).forEach(s=>c=c[s]||={}),c[o[o.length-1]]={...e[o.join(".")]}}),r}function X(e,t){return t.split(".").forEach(r=>e=e[r]),e}var B=[];function N(e){return B.find(t=>t.slice===e)}function L(e){i.inform("prerelease");let t={},r=ye(e),n=["name","path","state","computed","root","global","useSelect"],o=[],c=a=>({module:"createSlice",type:a,slice:r.name}),s=a=>({root:u(),rootState:a,global:y()}),u=()=>{let a=H();if(!a)throw new Error(d.RequiredStore(r.name));return a};C(c("mutation"),r.mutations,[n,o],(a,l)=>l?._reducerDefinitionType===E.ReducerType.asyncThunk||"reducer"in{...l||{}}?i.error(d.ReduxReducerConflict()):typeof l!="function"?i.error(d.InvalidMutation(a)):((j,Z)=>l(j,...Z.payload)));let p=(0,E.createSlice)({name:r.name,reducerPath:r.name,initialState:r.state,reducers:r.mutations}),h={path:r.name,slice:t,redux:p,children:{}};return m.defineReadonly(t,"name",()=>r.name),m.defineReadonly(t,"path",()=>h.path),m.defineReadonly(t,"global",()=>y()),m.defineMethod(t,"getState",()=>b(M(u()).getState(),h.path)),m.defineMethod(t,"useSelect",a=>(0,_.useSelector)(l=>{let f=s(b(l,""));return a.call(f,X(f.rootState,t.path),f)})),Object.entries(p.actions).map(([a,l])=>{t[a]=(...f)=>V(u())(l(f))}),C(c("method"),r.methods,[n,o],(a,l)=>typeof l!="function"?i.error(d.InvalidMethod(a)):t[a]=(...f)=>l.apply(t,f)),C(c("children"),r.children,[n,o],(a,l)=>N(l)?h.children[a]=l:i.error(d.InvalidChild(a))),Object.keys(r.computed).length>0&&i.warn("[OrcheStore::createSlice] Computed properties are not yet supported and will be ignored."),B.push(h),t}var ye=e=>{let t={...e||{}};if(D(t.name,d.RequiredName(),d.InvalidName(t.name)),typeof t.state=="function"){let u=t.state;t.state=()=>{let p=u();if(typeof p!="object")throw new Error(d.InvalidState(t.name));if(!p)throw new Error(d.RequiredState(t.name));return p}}else{if(typeof t.state!="object")throw new Error(d.InvalidState(t.name));if(!t.state)throw new Error(d.RequiredState(t.name))}t.mutations=typeof t.mutations=="object"&&t.mutations?{...t.mutations}:{},t.computed=typeof t.computed=="object"&&t.computed?{...t.computed}:{},t.methods=typeof t.methods=="object"&&t.methods?{...t.methods}:{},t.children=typeof t.children=="object"&&t.children?{...t.children}:{};let{reducers:r,extraReducers:n,reducerPath:o,initialState:c,selectors:s}={...t||{}};return c!==void 0&&i.warn(d.ReduxConflict("initialState")),r!==void 0&&i.warn(d.ReduxConflict("reducers")),n!==void 0&&i.warn(d.ReduxConflict("extraReducers")),o!==void 0&&i.warn(d.ReduxConflict("reducerPath")),s!==void 0&&i.warn(d.ReduxConflict("selectors")),t},d={RequiredName:()=>"[OrcheStore::createSlice] Missing required slice name. Expected a non-empty string.",InvalidName:e=>`[OrcheStore::createSlice] Slice names cannot contain '.' or '/'. Received: {${e}}`,RequiredState:e=>`[OrcheStore::createSlice] Missing required slice state for slice: {${e}}`,InvalidState:e=>`[OrcheStore::createSlice] Slice state must be a non-null object or a function that returns a non-null object. Slice: {${e}}`,ReservedKey:(e,t)=>`[OrcheStore::createSlice] '${t}' is reserved by OrcheStore and should not be provided as a ${e}.`,InvalidMutation:e=>`[OrcheStore::createSlice] Mutation '${e}' must be a function.`,InvalidMethod:e=>`[OrcheStore::createSlice] Method '${e}' must be a function.`,InvalidChild:e=>`[OrcheStore::createSlice] Child slice '${e}' must be a slice object created using createSlice(...).`,RequiredStore:e=>`[OrcheStore::slice-runtime] No root store found for slice: {${e}}. Slices must be created within the context of a store.
18
+ Create a store using createStore(...) and ensure that slices are accessed after the store is initialized.`,ReduxConflict:e=>`[OrcheStore::createSlice] '${e}' is a Redux Toolkit createSlice(...) option and is not applicable to OrcheStore slices. This property will be ignored.`,ReduxReducerConflict:()=>"[OrcheStore::createSlice] Redux Toolkit asyncThunk reducers are not supported in mutations. Use methods instead."};var Y=require("react-redux");var O=[];function M(e){return O.find(t=>t.store===e)?.redux}function H(){return O[0]?.store}function k({slices:e}){if(i.inform("prerelease"),O.length===1)return i.warn(`[OrcheStore::createStore] createStore(...) was called more than once.
19
+ OrcheStore currently supports only a single global store instance and will return the existing store.
20
+ If you are creating a store inside a React component, create it only once, for example:
21
+ const [store] = useState(() => createStore(...));
22
+ Avoid useState(createStore(...)) because createStore(...) will be executed on every render.`),O[0].store;let t={},r=s=>({root:t,rootState:s,global:y()});m.defineMethod(t,"getState",()=>b(c.getState(),"")),m.defineMethod(t,"useSelect",s=>(0,Y.useSelector)(u=>{let p=r(b(u,""));return s.call(p,p.rootState,p)}));let n={},o=(s,u,p)=>{let h=N(u)||{};if(!h)return;let{redux:a,children:l}=h;h.path=s,n[s]=a.reducer,p[s]=u,Object.entries(l).forEach(([f,j])=>{o(s+"."+f,j,u)})};for(let s in e){let u=e[s];s in t||o(s,u,t)}let c=(0,Q.configureStore)({reducer:n});return O.push({store:t,redux:c}),t}var be={createStore:k,createSlice:L,StoreProvider:G,provideGlobalUtils:q,getGlobalUtils:y,configureDiagnostics:U},xe=be;0&&(module.exports={StoreProvider,configureDiagnostics,createSlice,createStore,getGlobalUtils,provideGlobalUtils});
package/dist/index.d.cts CHANGED
@@ -1,4 +1,170 @@
1
- /** Test TSDoc */
2
- declare function test(): void;
1
+ import React from 'react';
2
+ import { ProviderProps } from 'react-redux';
3
3
 
4
- export { test };
4
+ type Dict<Value = any> = Record<string, Value>;
5
+ type Tail<T extends any[]> = T extends [any, ...infer R] ? R : T extends (infer U)[] ? U[] : never;
6
+ type DeepReadonly<T> = T extends (...args: any[]) => any ? T : T extends readonly (infer U)[] ? ReadonlyArray<DeepReadonly<U>> : T extends object ? {
7
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
8
+ } : T;
9
+
10
+ declare global {
11
+ namespace OrcheStore {
12
+ /** User-defined framework type slots. */
13
+ interface Slots {
14
+ }
15
+ }
16
+ }
17
+ /** Resolves a type slot with validation and fallback support. */
18
+ type Definition<T, Rule, Default> = T extends keyof OrcheStore.Slots ? Exclude<OrcheStore.Slots[T], undefined | null> extends Rule ? Exclude<OrcheStore.Slots[T], undefined | null> : Default : Default;
19
+ /** Validation rule for the `global` type slot. */
20
+ type GlobalUtilsRule = Record<PropertyKey, any>;
21
+ /** Validation rule for the `root` type slot. */
22
+ type RootStoreRule = Record<PropertyKey, any>;
23
+ /** Resolved type for application-wide global utilities. */
24
+ type GlobalUtils = Definition<"global", GlobalUtilsRule, any>;
25
+ /** Resolved type for the application root store. */
26
+ type RootStore = Definition<"root", RootStoreRule, any>;
27
+
28
+ /** Reserved slice member names that cannot be overridden by user-defined APIs. */
29
+ type ReservedKeys$1<R = {}, M = {}> = "name" | "path" | "computed" | "root" | "global" | "getState" | "useSelect" | keyof R | keyof M;
30
+ /** Defines the mutations available on a slice. */
31
+ type Mutations<S extends Dict> = Dict<(state: Omit<S, "computed">, ...args: any[]) => void>;
32
+ /** Defines the computed functions available on a slice. */
33
+ type Computed<S extends Dict, C extends Dict> = Dict<(state: ExposedState<S, C>, ...args: any[]) => any>;
34
+ /** Defines the methods available on a slice with contextual `this` typing. */
35
+ type Methods<Context = any> = Dict<(...args: any[]) => any> & ThisType<Context>;
36
+ /** Defines the child slices nested within a slice. */
37
+ type Children = Dict<slice<any, Mutations<any>, Methods, Dict, Computed<any, any>, any>>;
38
+ /** Exposes immutable slice state with optional runtime helpers. */
39
+ type ExposedState<S extends Dict, C extends Children = Children> = DeepReadonly<Omit<S, "computed">>;
40
+ /** Runtime slice API exposed by createSlice(...). */
41
+ type slice<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = {
42
+ /** Unique slice identifier. */
43
+ readonly name: N;
44
+ /** Fully qualified runtime path of the slice. */
45
+ readonly path: string;
46
+ /** Application-wide global utilities. */
47
+ readonly global: GlobalUtils;
48
+ /** Collection of derived state functions. */
49
+ readonly computed: {
50
+ readonly [K in keyof G]: (...args: Tail<Parameters<G[K]>>) => ReturnType<G[K]>;
51
+ };
52
+ /** Returns the latest immutable state snapshot. */
53
+ readonly getState: () => ExposedState<S, C>;
54
+ /** Subscribes to state changes within React components. Runs with a context-bound `this` containing `root` store, `rootState` and `global` utilities. */
55
+ readonly useSelect: <T>(selector: (this: UseSelectContext<RootStore>, state: ExposedState<S, C>, context: UseSelectContext<any>) => T) => T;
56
+ } & {
57
+ /** Exposed mutation functions. */
58
+ readonly [K in Exclude<keyof R, ReservedKeys$1>]: (...args: Tail<Parameters<R[K]>>) => ReturnType<R[K]>;
59
+ } & {
60
+ /** Exposed method functions. */
61
+ readonly [K in Exclude<keyof M, ReservedKeys$1<R>>]: M[K];
62
+ } & {
63
+ /** Exposed child slices. */
64
+ readonly [K in Exclude<keyof C, ReservedKeys$1<R, M>>]: C[K];
65
+ };
66
+ /** Context available inside `useSelect`, providing access to the root store, root state snapshot, and global utilities. */
67
+ type UseSelectContext<RootStore extends store> = {
68
+ /** Root store instance. */
69
+ root: RootStore;
70
+ /** Latest root state snapshot. */
71
+ rootState: ReturnType<RootStore["getState"]>;
72
+ /** Global utilities shared across slices. */
73
+ global: GlobalUtils;
74
+ };
75
+ /** Configuration object used to create a slice. */
76
+ type sliceOptions<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = {
77
+ /** Unique slice identifier. */
78
+ name: N;
79
+ /** Initial state object or lazy state initializer. */
80
+ state: S | (() => S);
81
+ /** Collection of synchronous state transition functions. */
82
+ mutations: R;
83
+ /** Collection of derived state functions. */
84
+ computed?: G & ThisType<G>;
85
+ /** Collection of slice methods and orchestration logic. */
86
+ methods?: M & ThisType<slice<S, R, M, C, G, N> & {
87
+ root: RootStore;
88
+ }>;
89
+ /** Collection of nested child slices. */
90
+ children?: C;
91
+ };
92
+
93
+ /** Reserved store member names that cannot be overridden by user-defined APIs. */
94
+ type ReservedKeys<R = {}, M = {}> = "name" | "path" | "computed" | "root" | "global" | "getState" | "useSelect";
95
+ type store<C extends Children = Children> = {
96
+ /** Returns the latest immutable state snapshot. */
97
+ readonly getState: () => ExposedState<{}, C>;
98
+ /** Subscribes to state changes within React components. Runs with a context-bound `this` containing `global` utilities. */
99
+ readonly useSelect: <T>(selector: (this: UseSelectContext<RootStore>, state: ExposedState<{}, C>, context: UseSelectContext<any>) => T) => T;
100
+ } & {
101
+ /** Exposed slices. */
102
+ readonly [K in Exclude<keyof C, ReservedKeys>]: C[K];
103
+ };
104
+
105
+ type orchestore = {};
106
+ declare global {
107
+ type OrcheStore = orchestore;
108
+ namespace OrcheStore {
109
+ type Store<C extends Children = Children> = store<C>;
110
+ /** Runtime slice API exposed by createSlice(...). */
111
+ type Slice<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = slice<S, R, M, C, G, N>;
112
+ /** Configuration object used to create a slice. */
113
+ type SliceOptions<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = sliceOptions<S, R, M, C, G, N>;
114
+ }
115
+ }
116
+
117
+ /** Creates and initializes an OrcheStore instance. */
118
+ declare function createStore<C extends Children = Children>({ slices }: {
119
+ slices: C;
120
+ }): store<C>;
121
+
122
+ /** Creates and initializes an OrcheStore slice. */
123
+ declare function createSlice<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string>(props: sliceOptions<S, R, M, C, G, N>): slice<S, R, M, C, G, N>;
124
+
125
+ type StoreProviderProps = Omit<ProviderProps, "store" | "serverState" | "context"> & {
126
+ /** The root OrcheStore instance created with `createStore(...)`. */
127
+ store: store;
128
+ };
129
+ /** Provides an OrcheStore instance to the React component tree. */
130
+ declare function StoreProvider(props: StoreProviderProps): React.JSX.Element;
131
+
132
+ /** Returns the current global utilities object. */
133
+ declare function getGlobalUtils(): GlobalUtils;
134
+ /** Registers or updates application-wide global utilities. */
135
+ declare function provideGlobalUtils(value: Partial<GlobalUtils>): GlobalUtils;
136
+
137
+ type DiagnosticsLevel = "off" | "errors" | "all";
138
+ /**
139
+ * Configures OrcheStore diagnostics output.
140
+ *
141
+ * Levels:
142
+ * - "off" - disables all output
143
+ * - "errors" - shows errors only
144
+ * - "all" - shows logs, warnings, and errors
145
+ */
146
+ declare function configureDiagnostics(level: DiagnosticsLevel): void;
147
+
148
+ declare const OrcheStore$1: {
149
+ /** Creates and initializes an OrcheStore instance. */
150
+ createStore: typeof createStore;
151
+ /** Creates and initializes an OrcheStore slice. */
152
+ createSlice: typeof createSlice;
153
+ /** Provides an OrcheStore instance to the React component tree. */
154
+ StoreProvider: typeof StoreProvider;
155
+ /** Registers or updates application-wide global utilities. */
156
+ provideGlobalUtils: typeof provideGlobalUtils;
157
+ /** Returns the current global utilities object. */
158
+ getGlobalUtils: typeof getGlobalUtils;
159
+ /**
160
+ * Configures OrcheStore diagnostics output.
161
+ *
162
+ * Levels:
163
+ * - "off" - disables all output
164
+ * - "errors" - shows errors only
165
+ * - "all" - shows logs, warnings, and errors
166
+ */
167
+ configureDiagnostics: typeof configureDiagnostics;
168
+ };
169
+
170
+ export { type GlobalUtils, type orchestore as OrcheStore, type RootStore, type slice as Slice, type sliceOptions as SliceOptions, type store as Store, StoreProvider, configureDiagnostics, createSlice, createStore, OrcheStore$1 as default, getGlobalUtils, provideGlobalUtils };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,170 @@
1
- /** Test TSDoc */
2
- declare function test(): void;
1
+ import React from 'react';
2
+ import { ProviderProps } from 'react-redux';
3
3
 
4
- export { test };
4
+ type Dict<Value = any> = Record<string, Value>;
5
+ type Tail<T extends any[]> = T extends [any, ...infer R] ? R : T extends (infer U)[] ? U[] : never;
6
+ type DeepReadonly<T> = T extends (...args: any[]) => any ? T : T extends readonly (infer U)[] ? ReadonlyArray<DeepReadonly<U>> : T extends object ? {
7
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
8
+ } : T;
9
+
10
+ declare global {
11
+ namespace OrcheStore {
12
+ /** User-defined framework type slots. */
13
+ interface Slots {
14
+ }
15
+ }
16
+ }
17
+ /** Resolves a type slot with validation and fallback support. */
18
+ type Definition<T, Rule, Default> = T extends keyof OrcheStore.Slots ? Exclude<OrcheStore.Slots[T], undefined | null> extends Rule ? Exclude<OrcheStore.Slots[T], undefined | null> : Default : Default;
19
+ /** Validation rule for the `global` type slot. */
20
+ type GlobalUtilsRule = Record<PropertyKey, any>;
21
+ /** Validation rule for the `root` type slot. */
22
+ type RootStoreRule = Record<PropertyKey, any>;
23
+ /** Resolved type for application-wide global utilities. */
24
+ type GlobalUtils = Definition<"global", GlobalUtilsRule, any>;
25
+ /** Resolved type for the application root store. */
26
+ type RootStore = Definition<"root", RootStoreRule, any>;
27
+
28
+ /** Reserved slice member names that cannot be overridden by user-defined APIs. */
29
+ type ReservedKeys$1<R = {}, M = {}> = "name" | "path" | "computed" | "root" | "global" | "getState" | "useSelect" | keyof R | keyof M;
30
+ /** Defines the mutations available on a slice. */
31
+ type Mutations<S extends Dict> = Dict<(state: Omit<S, "computed">, ...args: any[]) => void>;
32
+ /** Defines the computed functions available on a slice. */
33
+ type Computed<S extends Dict, C extends Dict> = Dict<(state: ExposedState<S, C>, ...args: any[]) => any>;
34
+ /** Defines the methods available on a slice with contextual `this` typing. */
35
+ type Methods<Context = any> = Dict<(...args: any[]) => any> & ThisType<Context>;
36
+ /** Defines the child slices nested within a slice. */
37
+ type Children = Dict<slice<any, Mutations<any>, Methods, Dict, Computed<any, any>, any>>;
38
+ /** Exposes immutable slice state with optional runtime helpers. */
39
+ type ExposedState<S extends Dict, C extends Children = Children> = DeepReadonly<Omit<S, "computed">>;
40
+ /** Runtime slice API exposed by createSlice(...). */
41
+ type slice<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = {
42
+ /** Unique slice identifier. */
43
+ readonly name: N;
44
+ /** Fully qualified runtime path of the slice. */
45
+ readonly path: string;
46
+ /** Application-wide global utilities. */
47
+ readonly global: GlobalUtils;
48
+ /** Collection of derived state functions. */
49
+ readonly computed: {
50
+ readonly [K in keyof G]: (...args: Tail<Parameters<G[K]>>) => ReturnType<G[K]>;
51
+ };
52
+ /** Returns the latest immutable state snapshot. */
53
+ readonly getState: () => ExposedState<S, C>;
54
+ /** Subscribes to state changes within React components. Runs with a context-bound `this` containing `root` store, `rootState` and `global` utilities. */
55
+ readonly useSelect: <T>(selector: (this: UseSelectContext<RootStore>, state: ExposedState<S, C>, context: UseSelectContext<any>) => T) => T;
56
+ } & {
57
+ /** Exposed mutation functions. */
58
+ readonly [K in Exclude<keyof R, ReservedKeys$1>]: (...args: Tail<Parameters<R[K]>>) => ReturnType<R[K]>;
59
+ } & {
60
+ /** Exposed method functions. */
61
+ readonly [K in Exclude<keyof M, ReservedKeys$1<R>>]: M[K];
62
+ } & {
63
+ /** Exposed child slices. */
64
+ readonly [K in Exclude<keyof C, ReservedKeys$1<R, M>>]: C[K];
65
+ };
66
+ /** Context available inside `useSelect`, providing access to the root store, root state snapshot, and global utilities. */
67
+ type UseSelectContext<RootStore extends store> = {
68
+ /** Root store instance. */
69
+ root: RootStore;
70
+ /** Latest root state snapshot. */
71
+ rootState: ReturnType<RootStore["getState"]>;
72
+ /** Global utilities shared across slices. */
73
+ global: GlobalUtils;
74
+ };
75
+ /** Configuration object used to create a slice. */
76
+ type sliceOptions<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = {
77
+ /** Unique slice identifier. */
78
+ name: N;
79
+ /** Initial state object or lazy state initializer. */
80
+ state: S | (() => S);
81
+ /** Collection of synchronous state transition functions. */
82
+ mutations: R;
83
+ /** Collection of derived state functions. */
84
+ computed?: G & ThisType<G>;
85
+ /** Collection of slice methods and orchestration logic. */
86
+ methods?: M & ThisType<slice<S, R, M, C, G, N> & {
87
+ root: RootStore;
88
+ }>;
89
+ /** Collection of nested child slices. */
90
+ children?: C;
91
+ };
92
+
93
+ /** Reserved store member names that cannot be overridden by user-defined APIs. */
94
+ type ReservedKeys<R = {}, M = {}> = "name" | "path" | "computed" | "root" | "global" | "getState" | "useSelect";
95
+ type store<C extends Children = Children> = {
96
+ /** Returns the latest immutable state snapshot. */
97
+ readonly getState: () => ExposedState<{}, C>;
98
+ /** Subscribes to state changes within React components. Runs with a context-bound `this` containing `global` utilities. */
99
+ readonly useSelect: <T>(selector: (this: UseSelectContext<RootStore>, state: ExposedState<{}, C>, context: UseSelectContext<any>) => T) => T;
100
+ } & {
101
+ /** Exposed slices. */
102
+ readonly [K in Exclude<keyof C, ReservedKeys>]: C[K];
103
+ };
104
+
105
+ type orchestore = {};
106
+ declare global {
107
+ type OrcheStore = orchestore;
108
+ namespace OrcheStore {
109
+ type Store<C extends Children = Children> = store<C>;
110
+ /** Runtime slice API exposed by createSlice(...). */
111
+ type Slice<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = slice<S, R, M, C, G, N>;
112
+ /** Configuration object used to create a slice. */
113
+ type SliceOptions<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string> = sliceOptions<S, R, M, C, G, N>;
114
+ }
115
+ }
116
+
117
+ /** Creates and initializes an OrcheStore instance. */
118
+ declare function createStore<C extends Children = Children>({ slices }: {
119
+ slices: C;
120
+ }): store<C>;
121
+
122
+ /** Creates and initializes an OrcheStore slice. */
123
+ declare function createSlice<S extends Dict = Dict, R extends Mutations<S> = Mutations<S>, M extends Methods = Methods, C extends Children = Children, G extends Computed<S, C> = Computed<S, C>, N extends string = string>(props: sliceOptions<S, R, M, C, G, N>): slice<S, R, M, C, G, N>;
124
+
125
+ type StoreProviderProps = Omit<ProviderProps, "store" | "serverState" | "context"> & {
126
+ /** The root OrcheStore instance created with `createStore(...)`. */
127
+ store: store;
128
+ };
129
+ /** Provides an OrcheStore instance to the React component tree. */
130
+ declare function StoreProvider(props: StoreProviderProps): React.JSX.Element;
131
+
132
+ /** Returns the current global utilities object. */
133
+ declare function getGlobalUtils(): GlobalUtils;
134
+ /** Registers or updates application-wide global utilities. */
135
+ declare function provideGlobalUtils(value: Partial<GlobalUtils>): GlobalUtils;
136
+
137
+ type DiagnosticsLevel = "off" | "errors" | "all";
138
+ /**
139
+ * Configures OrcheStore diagnostics output.
140
+ *
141
+ * Levels:
142
+ * - "off" - disables all output
143
+ * - "errors" - shows errors only
144
+ * - "all" - shows logs, warnings, and errors
145
+ */
146
+ declare function configureDiagnostics(level: DiagnosticsLevel): void;
147
+
148
+ declare const OrcheStore$1: {
149
+ /** Creates and initializes an OrcheStore instance. */
150
+ createStore: typeof createStore;
151
+ /** Creates and initializes an OrcheStore slice. */
152
+ createSlice: typeof createSlice;
153
+ /** Provides an OrcheStore instance to the React component tree. */
154
+ StoreProvider: typeof StoreProvider;
155
+ /** Registers or updates application-wide global utilities. */
156
+ provideGlobalUtils: typeof provideGlobalUtils;
157
+ /** Returns the current global utilities object. */
158
+ getGlobalUtils: typeof getGlobalUtils;
159
+ /**
160
+ * Configures OrcheStore diagnostics output.
161
+ *
162
+ * Levels:
163
+ * - "off" - disables all output
164
+ * - "errors" - shows errors only
165
+ * - "all" - shows logs, warnings, and errors
166
+ */
167
+ configureDiagnostics: typeof configureDiagnostics;
168
+ };
169
+
170
+ export { type GlobalUtils, type orchestore as OrcheStore, type RootStore, type slice as Slice, type sliceOptions as SliceOptions, type store as Store, StoreProvider, configureDiagnostics, createSlice, createStore, OrcheStore$1 as default, getGlobalUtils, provideGlobalUtils };
package/dist/index.js CHANGED
@@ -1,7 +1,22 @@
1
- // src/index.ts
2
- function test() {
3
- console.log("Working");
4
- }
5
- export {
6
- test
7
- };
1
+ import{configureStore as de}from"@reduxjs/toolkit";import{createSlice as se,ReducerType as ae}from"@reduxjs/toolkit";import{useSelector as ce}from"react-redux";var g={target:({slice:e})=>e?` Affected slice '${e}':
2
+ `:" ",RequiredName:e=>`[OrcheStore::${e.module}]${g.target(e)}${e.type} keys must be non-empty strings.`,InvalidName:(e,t)=>`[OrcheStore::${e.module}]${g.target(e)}${e.type} names cannot contain '.' or '/'. Received: ${t}.`,ReservedKey:(e,t)=>`[OrcheStore::${e.module}]${g.target(e)}'${t}' is a reserved name and cannot be used as a ${e.type} key.`,DuplicateKey:(e,t)=>`[OrcheStore::${e.module}]${g.target(e)}${e.type} name '${t}' conflicts with another member.`},G=(e,t)=>{if(e)if(t==="warn")console.warn(e);else if(t==="error")console.error(e);else throw new Error(e);else return!1},E=(e,t="",r="",n)=>typeof e!="string"||!e?!!G(t,n?.[0]):e.includes(".")||e.includes("/")?!!G(r,n?.[1]):!0,_=(e,t,r)=>{let[n,o]=[g.RequiredName(e),g.InvalidName(e,t)];if(E(t,n,o,["error","error"])){if(r[0].includes(t))return console.error(g.ReservedKey(e,t));if(r[1].includes(t))return console.error(g.DuplicateKey(e,t))}else return;return!0},R=(e,t,r,n)=>(Object.entries(t).forEach(([o,c])=>{let s=_(e,o,r)?n(o,c):void 0;if(s===void 0)return delete t[o];t[o]=s,r[1].push(o)}),t);var v="all",j={diagnostics:!1,prerelease:!1},A=globalThis.console?.log?.bind?.(globalThis.console)||globalThis.console?.log,B=globalThis.console?.warn?.bind?.(globalThis.console)||globalThis.console?.warn,H=globalThis.console?.error?.bind?.(globalThis.console)||globalThis.console?.error,Q=globalThis.console?.clear?.bind?.(globalThis.console)||globalThis.console?.clear;globalThis.console?.clear&&(globalThis.console.clear=(...e)=>{j.diagnostics=!1,Q?.(...e)});var Y=`[OrcheStore] \u{1F6A7} Pre-release Notice
3
+ Thank you for your interest in OrcheStore.
4
+ OrcheStore is currently under active development and is not yet ready for production use.
5
+ APIs, behavior, and internal implementation details may change without notice.
6
+ The first stable release is currently planned for 2026-06-30.
7
+ Stay tuned for updates!
8
+ `,Z=`[OrcheStore] Diagnostics are enabled.
9
+ OrcheStore may emit warnings and errors to help identify incorrect usage, invalid configurations, and potential runtime issues.
10
+ Runtime exceptions that stop code execution may still occur regardless of diagnostics settings.
11
+ Please resolve all OrcheStore warnings and errors before deploying to production.
12
+ Diagnostics can be configured with configureDiagnostics("off" | "errors" | "all").
13
+ `,i={inform(e){j[e]||(j[e]=!0,v==="all"&&A?.(e==="prerelease"?Y:Z))},log(...e){v==="all"&&(i.inform("diagnostics"),A?.(...e))},warn(...e){v==="all"&&(i.inform("diagnostics"),B?.(...e))},error(...e){v!=="off"&&(i.inform("diagnostics"),H?.(...e))}};function K(e){v=e}import C from"react";import{Provider as ee,useDispatch as te}from"react-redux";var D=[];function q(e){let t=D.find(r=>r.store===e);if(t)return t.dispatch;throw new Error("[OrcheStore] Using OrcheStore requires wrapping your application with <StoreProvider>.")}function re({store:e,children:t}){let r=te(),n=D.find(o=>o.store===e);return n||D.push(n={store:e,dispatch:r}),n.dispatch=r,C.createElement(C.Fragment,null,t)}function N(e){let{store:t,stabilityCheck:r,identityFunctionCheck:n}={...e||{}},o=P(t);if(!o)throw new Error("[OrcheStore::context] <StoreProvider> requires a store instance created with createStore(...).");return C.createElement(ee,{stabilityCheck:r,identityFunctionCheck:n,store:o},C.createElement(re,{...e}))}var oe=Object.assign,$=Object.getOwnPropertyDescriptor(Object,"defineProperty")?.value||Object.defineProperty,ne=(e,t,r)=>{$(e,t,{get:r,enumerable:!0,configurable:!1})},ie=(e,t,r)=>{$(e,t,{value:r,writable:!1,enumerable:!0,configurable:!1})},m={assign:oe,defineProp:$,defineReadonly:ne,defineMethod:ie},L={isArray:Array.isArray},M={get:Reflect.get,set:Reflect.set,delete:Reflect.deleteProperty};var w={GetMissingProp:e=>["[OrcheStore::global-utils] Attempted to access a global utility before it became available. Missing property",e,`
14
+ If this utility is optional, register it as undefined using provideGlobalUtils(...) to suppress future warnings.
15
+ `],DeleteProp:e=>["[OrcheStore::global-utils] Avoid deleting properties. Trying to delete property",e,`
16
+ Use provideGlobalUtils(...) to set them to undefined instead for type safety.
17
+ `],InvalidArgs:"[OrcheStore::global-utils] Expected provideGlobalUtils(...) to receive a non-null object. Received:"},U=new Proxy({},{get(e,t,r){return t in e||i.error(...w.GetMissingProp(t)),M.get(e,t,r)},set(e,t,r,n){return M.set(e,t,r,n)},deleteProperty(e,t){return i.warn(...w.DeleteProp(t)),M.delete(e,t)}});function b(){return U}function k(e){return e==null?i.error(w.InvalidArgs,e):L.isArray(e)?i.error(w.InvalidArgs,"(type: array)",e):typeof e!="object"?i.error(w.InvalidArgs,`(type: ${typeof e})`,e):m.assign(U,e),U}function x(e,t){let r={};return Object.keys(e).filter(o=>o.startsWith(t)).map(o=>o.split(".")).sort((o,c)=>o.length-c.length).forEach(o=>{let c=r;o.slice(0,o.length-1).forEach(s=>c=c[s]||={}),c[o[o.length-1]]={...e[o.join(".")]}}),r}function z(e,t){return t.split(".").forEach(r=>e=e[r]),e}var F=[];function I(e){return F.find(t=>t.slice===e)}function J(e){i.inform("prerelease");let t={},r=le(e),n=["name","path","state","computed","root","global","useSelect"],o=[],c=a=>({module:"createSlice",type:a,slice:r.name}),s=a=>({root:u(),rootState:a,global:b()}),u=()=>{let a=V();if(!a)throw new Error(d.RequiredStore(r.name));return a};R(c("mutation"),r.mutations,[n,o],(a,l)=>l?._reducerDefinitionType===ae.asyncThunk||"reducer"in{...l||{}}?i.error(d.ReduxReducerConflict()):typeof l!="function"?i.error(d.InvalidMutation(a)):((T,X)=>l(T,...X.payload)));let p=se({name:r.name,reducerPath:r.name,initialState:r.state,reducers:r.mutations}),h={path:r.name,slice:t,redux:p,children:{}};return m.defineReadonly(t,"name",()=>r.name),m.defineReadonly(t,"path",()=>h.path),m.defineReadonly(t,"global",()=>b()),m.defineMethod(t,"getState",()=>x(P(u()).getState(),h.path)),m.defineMethod(t,"useSelect",a=>ce(l=>{let f=s(x(l,""));return a.call(f,z(f.rootState,t.path),f)})),Object.entries(p.actions).map(([a,l])=>{t[a]=(...f)=>q(u())(l(f))}),R(c("method"),r.methods,[n,o],(a,l)=>typeof l!="function"?i.error(d.InvalidMethod(a)):t[a]=(...f)=>l.apply(t,f)),R(c("children"),r.children,[n,o],(a,l)=>I(l)?h.children[a]=l:i.error(d.InvalidChild(a))),Object.keys(r.computed).length>0&&i.warn("[OrcheStore::createSlice] Computed properties are not yet supported and will be ignored."),F.push(h),t}var le=e=>{let t={...e||{}};if(E(t.name,d.RequiredName(),d.InvalidName(t.name)),typeof t.state=="function"){let u=t.state;t.state=()=>{let p=u();if(typeof p!="object")throw new Error(d.InvalidState(t.name));if(!p)throw new Error(d.RequiredState(t.name));return p}}else{if(typeof t.state!="object")throw new Error(d.InvalidState(t.name));if(!t.state)throw new Error(d.RequiredState(t.name))}t.mutations=typeof t.mutations=="object"&&t.mutations?{...t.mutations}:{},t.computed=typeof t.computed=="object"&&t.computed?{...t.computed}:{},t.methods=typeof t.methods=="object"&&t.methods?{...t.methods}:{},t.children=typeof t.children=="object"&&t.children?{...t.children}:{};let{reducers:r,extraReducers:n,reducerPath:o,initialState:c,selectors:s}={...t||{}};return c!==void 0&&i.warn(d.ReduxConflict("initialState")),r!==void 0&&i.warn(d.ReduxConflict("reducers")),n!==void 0&&i.warn(d.ReduxConflict("extraReducers")),o!==void 0&&i.warn(d.ReduxConflict("reducerPath")),s!==void 0&&i.warn(d.ReduxConflict("selectors")),t},d={RequiredName:()=>"[OrcheStore::createSlice] Missing required slice name. Expected a non-empty string.",InvalidName:e=>`[OrcheStore::createSlice] Slice names cannot contain '.' or '/'. Received: {${e}}`,RequiredState:e=>`[OrcheStore::createSlice] Missing required slice state for slice: {${e}}`,InvalidState:e=>`[OrcheStore::createSlice] Slice state must be a non-null object or a function that returns a non-null object. Slice: {${e}}`,ReservedKey:(e,t)=>`[OrcheStore::createSlice] '${t}' is reserved by OrcheStore and should not be provided as a ${e}.`,InvalidMutation:e=>`[OrcheStore::createSlice] Mutation '${e}' must be a function.`,InvalidMethod:e=>`[OrcheStore::createSlice] Method '${e}' must be a function.`,InvalidChild:e=>`[OrcheStore::createSlice] Child slice '${e}' must be a slice object created using createSlice(...).`,RequiredStore:e=>`[OrcheStore::slice-runtime] No root store found for slice: {${e}}. Slices must be created within the context of a store.
18
+ Create a store using createStore(...) and ensure that slices are accessed after the store is initialized.`,ReduxConflict:e=>`[OrcheStore::createSlice] '${e}' is a Redux Toolkit createSlice(...) option and is not applicable to OrcheStore slices. This property will be ignored.`,ReduxReducerConflict:()=>"[OrcheStore::createSlice] Redux Toolkit asyncThunk reducers are not supported in mutations. Use methods instead."};import{useSelector as ue}from"react-redux";var O=[];function P(e){return O.find(t=>t.store===e)?.redux}function V(){return O[0]?.store}function W({slices:e}){if(i.inform("prerelease"),O.length===1)return i.warn(`[OrcheStore::createStore] createStore(...) was called more than once.
19
+ OrcheStore currently supports only a single global store instance and will return the existing store.
20
+ If you are creating a store inside a React component, create it only once, for example:
21
+ const [store] = useState(() => createStore(...));
22
+ Avoid useState(createStore(...)) because createStore(...) will be executed on every render.`),O[0].store;let t={},r=s=>({root:t,rootState:s,global:b()});m.defineMethod(t,"getState",()=>x(c.getState(),"")),m.defineMethod(t,"useSelect",s=>ue(u=>{let p=r(x(u,""));return s.call(p,p.rootState,p)}));let n={},o=(s,u,p)=>{let h=I(u)||{};if(!h)return;let{redux:a,children:l}=h;h.path=s,n[s]=a.reducer,p[s]=u,Object.entries(l).forEach(([f,T])=>{o(s+"."+f,T,u)})};for(let s in e){let u=e[s];s in t||o(s,u,t)}let c=de({reducer:n});return O.push({store:t,redux:c}),t}var pe={createStore:W,createSlice:J,StoreProvider:N,provideGlobalUtils:k,getGlobalUtils:b,configureDiagnostics:K},tt=pe;export{N as StoreProvider,K as configureDiagnostics,J as createSlice,W as createStore,tt as default,b as getGlobalUtils,k as provideGlobalUtils};
package/package.json CHANGED
@@ -1,55 +1,72 @@
1
- {
2
- "name": "orchestore",
3
- "version": "0.1.0",
4
- "description": "A function-oriented architecture built on top of Redux Toolkit for simplifying and automating application development.",
5
- "author": "Oussama Saadaoui",
6
- "license": "MIT",
7
- "type": "module",
8
- "main": "./dist/index.js",
9
- "types": "./dist/index.d.ts",
10
- "scripts": {
11
- "build": "tsup"
12
- },
13
- "exports": {
14
- ".": {
15
- "import": "./dist/index.js",
16
- "types": "./dist/index.d.ts"
17
- }
18
- },
19
- "files": [
20
- "dist"
21
- ],
22
- "homepage": "https://github.com/saadaoui-oussama-dev/OrcheStore#readme",
23
- "bugs": {
24
- "url": "https://github.com/saadaoui-oussama-dev/OrcheStore/issues"
25
- },
26
- "repository": {
27
- "type": "git",
28
- "url": "https://github.com/saadaoui-oussama-dev/OrcheStore.git"
29
- },
30
- "keywords": [
31
- "orchestore",
32
- "store",
33
- "slice",
34
- "state",
35
- "global-store",
36
- "global-state",
37
- "typed-store",
38
- "typed-state",
39
- "react",
40
- "react-store",
41
- "react-state",
42
- "react-redux",
43
- "redux",
44
- "redux-toolkit",
45
- "frontend",
46
- "typescript",
47
- "orchestration",
48
- "state-management",
49
- "state-orchestration"
50
- ],
51
- "devDependencies": {
52
- "tsup": "^8.5.1",
53
- "typescript": "^6.0.3"
54
- }
55
- }
1
+ {
2
+ "name": "orchestore",
3
+ "version": "0.1.2",
4
+ "description": "A function-oriented architecture built on top of Redux Toolkit for simplifying and automating application development.",
5
+ "author": "Oussama Saadaoui",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./src/index.cjs",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "scripts": {
12
+ "start": "tsup && node scripts/pack.mjs",
13
+ "build": "tsup && node scripts/pack.mjs",
14
+ "check": "tsc --noEmit",
15
+ "lint": "eslint ."
16
+ },
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.cjs"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "homepage": "https://github.com/saadaoui-oussama-dev/OrcheStore#readme",
28
+ "bugs": {
29
+ "url": "https://github.com/saadaoui-oussama-dev/OrcheStore/issues"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/saadaoui-oussama-dev/OrcheStore.git"
34
+ },
35
+ "dependencies": {
36
+ "@reduxjs/toolkit": "^2.12.0",
37
+ "react-redux": "^9.3.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/react": "^19.0.0",
41
+ "@types/react-dom": "^19.0.0",
42
+ "eslint": "^9.0.0",
43
+ "tsup": "^8.5.1",
44
+ "typescript": "^6.0.3"
45
+ },
46
+ "peerDependencies": {
47
+ "react": "^16.9.0 || ^17 || ^18 || ^19",
48
+ "react-dom": "^16.9.0 || ^17 || ^18 || ^19"
49
+ },
50
+ "keywords": [
51
+ "orchestore",
52
+ "store",
53
+ "slice",
54
+ "state",
55
+ "global-store",
56
+ "global-state",
57
+ "typed-store",
58
+ "typed-state",
59
+ "react",
60
+ "react-store",
61
+ "react-state",
62
+ "react-redux",
63
+ "redux",
64
+ "redux-toolkit",
65
+ "redux-automation",
66
+ "frontend",
67
+ "typescript",
68
+ "orchestration",
69
+ "state-management",
70
+ "state-orchestration"
71
+ ]
72
+ }