@vef-framework/core 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # The Core of VEF Framework
2
+
3
+ VEF framework designed by Venus is built on top of React, and it provides a set of components that are essential for building a modern web application. These components are designed to be highly customizable and reusable, allowing developers to build complex and dynamic user interfaces with ease.
4
+
5
+ ## Installation
6
+
7
+ To install the VEF framework core, you can use pnpm or any other package manager you like:
8
+
9
+ ```bash
10
+ pnpm add @vef-framework/core
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ To use the VEF framework core in your project, you can import them from the package, for example:
16
+
17
+ ```ts
18
+ import { xxx } from "@vef-framework/core";
19
+
20
+ const result = xxx();
21
+ ```
22
+
23
+ ## Documentation
24
+
25
+ For more details on how to use the VEF framework core, please refer to the [official documentation](https://vef.ilxqx.com/docs).
@@ -0,0 +1,175 @@
1
+ import type { AnyValue, Api, ApiResponse, BiMapperOptional1, ChildrenProps, Except, Mapper, MaybeUndefined, MutationApi, MutationResult, ObjectType, ObjectValue, QueryApi, QueryResult, VefError } from "@vef-framework/shared";
2
+ import { type UseQueryOptions } from "@tanstack/react-query";
3
+ import { type FC } from "react";
4
+ import { type QueryClientOptions } from "./query-client";
5
+ import { type RequestClientOptions, type RequestOptions } from "./request-client";
6
+ /**
7
+ * The request methods.
8
+ */
9
+ export interface RequestMethods<R = unknown> {
10
+ get: <P extends ObjectType = ObjectValue>(url: string, options?: Except<RequestOptions<P>, "onProgress" | "signal">) => Promise<ApiResponse<R>>;
11
+ post: <D extends ObjectType = ObjectValue, P extends ObjectType = ObjectValue>(url: string, data?: D, options?: Except<RequestOptions<P>, "onProgress" | "signal">) => Promise<ApiResponse<R>>;
12
+ put: <D extends ObjectType = ObjectValue, P extends ObjectType = ObjectValue>(url: string, data?: D, options?: Except<RequestOptions<P>, "onProgress" | "signal">) => Promise<ApiResponse<R>>;
13
+ delete: <P extends ObjectType = ObjectValue>(url: string, options?: Except<RequestOptions<P>, "onProgress" | "signal">) => Promise<ApiResponse<R>>;
14
+ }
15
+ /**
16
+ * The API client options.
17
+ */
18
+ export type ApiClientOptions = {} & RequestClientOptions & QueryClientOptions;
19
+ /**
20
+ * The query options.
21
+ */
22
+ export type QueryOptions<R = unknown> = {
23
+ /**
24
+ * Whether to keep the previous data.
25
+ */
26
+ keepPreviousData?: boolean;
27
+ /**
28
+ * The initial data.
29
+ */
30
+ initialData?: R;
31
+ } & Pick<UseQueryOptions<ApiResponse<R>, VefError, R>, "staleTime" | "enabled" | "placeholderData" | "refetchInterval" | "refetchIntervalInBackground" | "refetchOnMount" | "refetchOnWindowFocus">;
32
+ /**
33
+ * The API client.
34
+ */
35
+ export declare class ApiClient {
36
+ #private;
37
+ readonly options: ApiClientOptions;
38
+ /**
39
+ * The useApiQuery hook.
40
+ * These hook functions are doing this because React's Hooks cannot be used in class methods,
41
+ * and this approach can bypass the check.
42
+ */
43
+ readonly useApiQuery: <T = unknown, R = unknown>(queryFn: Readonly<QueryApi<T, R>>, args: T, options?: QueryOptions<R>) => QueryResult<R>;
44
+ /**
45
+ * The useApiMutation hook.
46
+ * These hook functions are doing this because React's Hooks cannot be used in class methods,
47
+ * and this approach can bypass the check.
48
+ */
49
+ readonly useApiMutation: <T = unknown, R = unknown>(mutationFn: Readonly<MutationApi<T, R>>) => MutationResult<T, R>;
50
+ /**
51
+ * The useIsFetching hook.
52
+ */
53
+ readonly useIsFetching: BiMapperOptional1<string, unknown, boolean>;
54
+ /**
55
+ * The useIsMutating hook.
56
+ */
57
+ readonly useIsMutating: Mapper<string, boolean>;
58
+ /**
59
+ * THe QueryClientProvider component.
60
+ */
61
+ readonly QueryClientProvider: FC<ChildrenProps>;
62
+ /**
63
+ * Create an API client.
64
+ *
65
+ * @param options - The options of the API client.
66
+ */
67
+ constructor(options: ApiClientOptions);
68
+ /**
69
+ * Fetch the API query.
70
+ *
71
+ * @param queryFn - The API function.
72
+ * @param args - The arguments of the API.
73
+ * @param options - The options of the API.
74
+ * @returns The API query.
75
+ */
76
+ fetchApiQuery<T extends ObjectType = ObjectValue, R = unknown>(queryFn: Api<T, R>, args: T, options?: Pick<QueryOptions<R>, "initialData">): Promise<R>;
77
+ /**
78
+ * Create a query API.
79
+ *
80
+ * @param key - The key of the API.
81
+ * @param factory - The factory of the API function.
82
+ * @returns The query API.
83
+ */
84
+ createQueryApi<T extends ObjectType = ObjectValue, R = AnyValue>(key: string, factory: Mapper<RequestMethods<R>, Mapper<T, Promise<ApiResponse<R>>>>): Readonly<QueryApi<T, R>>;
85
+ /**
86
+ * Create a mutation API.
87
+ *
88
+ * @param key - The key of the API.
89
+ * @param factory - The factory of the API function.
90
+ * @param relatedQueries - The related queries.
91
+ * @returns The mutation API.
92
+ */
93
+ createMutationApi<T, R>(key: string, factory: Mapper<Except<RequestMethods<R>, "get">, Mapper<T, Promise<ApiResponse<R>>>>, relatedQueries?: Array<Readonly<QueryApi<any, any>>>): Readonly<MutationApi<T, R>>;
94
+ /**
95
+ * Get the API query data.
96
+ *
97
+ * @param apiKey - The key of the API.
98
+ * @param args - The arguments of the API.
99
+ * @returns The API query data.
100
+ */
101
+ getApiQueryData<T>(apiKey: string, args?: unknown): T | undefined;
102
+ /**
103
+ * Get the API queries data.
104
+ *
105
+ * @param apiKey - The key of the API.
106
+ * @param args - The arguments of the API.
107
+ * @returns The API queries data.
108
+ */
109
+ getApiQueriesData(apiKey: string, args?: unknown): [import("@tanstack/react-query").QueryKey, unknown][];
110
+ /**
111
+ * Set the API query data.
112
+ *
113
+ * @param data - The data.
114
+ * @param apiKey - The key of the API.
115
+ * @param args - The arguments of the API.
116
+ */
117
+ setApiQueryData<T>(data: MaybeUndefined<T | Mapper<MaybeUndefined<T>, MaybeUndefined<T>>>, apiKey: string, args?: unknown): void;
118
+ /**
119
+ * Remove the API queries.
120
+ *
121
+ * @param apiKey - The key of the API.
122
+ * @param args - The arguments of the API.
123
+ */
124
+ removeApiQueries(apiKey: string, args?: unknown): void;
125
+ /**
126
+ * Invalidate the API queries.
127
+ *
128
+ * @param apiKey - The key of the API.
129
+ * @param args - The arguments of the API.
130
+ */
131
+ invalidateApiQueries(apiKey: string, args?: unknown): Promise<void>;
132
+ /**
133
+ * Reset the API queries.
134
+ *
135
+ * @param apiKey - The key of the API.
136
+ * @param args - The arguments of the API.
137
+ */
138
+ resetApiQueries(apiKey: string, args?: unknown): Promise<void>;
139
+ /**
140
+ * Refetch the API queries.
141
+ *
142
+ * @param apiKey - The key of the API.
143
+ * @param args - The arguments of the API.
144
+ */
145
+ refetchApiQueries(apiKey: string, args?: unknown): Promise<void>;
146
+ /**
147
+ * Cancel the API queries.
148
+ *
149
+ * @param apiKey - The key of the API.
150
+ * @param args - The arguments of the API.
151
+ */
152
+ cancelApiQueries(apiKey: string, args?: unknown): Promise<void>;
153
+ /**
154
+ * Check if the API query/queries is fetching.
155
+ *
156
+ * @param apiKey - The key of the API.
157
+ * @param args - The arguments of the API.
158
+ * @returns Whether the API query is fetching.
159
+ */
160
+ isFetching(apiKey: string, args?: unknown): boolean;
161
+ /**
162
+ * Check if the API mutation is mutating.
163
+ *
164
+ * @param apiKey - The key of the API.
165
+ * @returns Whether the API mutation is mutating.
166
+ */
167
+ isMutating(apiKey: string): boolean;
168
+ }
169
+ /**
170
+ * Create an API client.
171
+ *
172
+ * @param options - The options of the API client.
173
+ * @returns The API client.
174
+ */
175
+ export declare function createApiClient(options: ApiClientOptions): Readonly<ApiClient>;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{useQuery as e,keepPreviousData as t,useMutation as i,useIsFetching as r,useIsMutating as s,QueryClientProvider as a}from"@tanstack/react-query";import{createElement as n}from"react";import{createQueryClient as u}from"./query-client.js";import{createRequestClient as c}from"./request-client.js";var h,o,l,d,y,g,p,f,Q=Object.defineProperty,v=e=>{throw TypeError(e)},m=(e,t,i)=>((e,t,i)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),A=(e,t,i)=>t.has(e)||v("Cannot "+i),b=(e,t,i)=>(A(e,t,"read from private field"),i?i.call(e):t.get(e)),D=(e,t,i)=>t.has(e)?v("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),w=(e,t,i,r)=>(A(e,t,"write to private field"),r?r.call(e,i):t.set(e,i),i),q=(e,t,i)=>(A(e,t,"access private method"),i);class M{constructor(f){this.options=f,D(this,y),m(this,"useApiQuery"),m(this,"useApiMutation"),m(this,"useIsFetching"),m(this,"useIsMutating"),m(this,"QueryClientProvider"),D(this,h),D(this,o),D(this,l),D(this,d),w(this,h,u(f)),w(this,o,c(f)),w(this,l,{get:async(e,t)=>{const i=b(this,d);return w(this,d,void 0),await b(this,o).get(e,{...t,signal:i})},post:async(e,t,i)=>{const r=b(this,d);return w(this,d,void 0),await b(this,o).post(e,t,{...i,signal:r})},put:async(e,t,i)=>{const r=b(this,d);return w(this,d,void 0),await b(this,o).put(e,t,{...i,signal:r})},delete:async(e,t)=>{const i=b(this,d);return w(this,d,void 0),await b(this,o).delete(e,{...t,signal:i})}});const Q=this;this.useApiQuery=function(i,r,s){var a;const{keepPreviousData:n,placeholderData:u,initialData:c,...h}=s??{},o=e({queryKey:[i.key,r],queryFn:({signal:e})=>i(r,{signal:e}),select:q(Q,y,g),placeholderData:u??!0===n?t:void 0,initialData:c?{code:0,message:"ok",data:c}:void 0,...h});return q(a=Q,y,p).call(a,o)},this.useApiMutation=function(e){const{isPending:t,isIdle:r,isError:s,isSuccess:a,error:n,data:u,mutateAsync:c}=i({mutationKey:[e.key],mutationFn:t=>e(t)});return{mutate:async e=>await c(e),isPending:t,isIdle:r,isError:s,isSuccess:a,message:u?.message,error:n??void 0,data:u?.data}},this.useIsFetching=function(e,t){return r({queryKey:arguments.length>1?[e,t]:[e],type:"active",exact:!1})>0},this.useIsMutating=function(e){return s({mutationKey:[e],exact:!1})>0},this.QueryClientProvider=function({children:e}){return n(a,{client:b(Q,h)},e)}}async fetchApiQuery(e,t,i){const{initialData:r,...s}=i??{};return(await b(this,h).fetchQuery({queryKey:[e.key,t],queryFn:({signal:i})=>e(t,{signal:i}),initialData:r?{code:0,message:"ok",data:r}:void 0,...s})).data}createQueryApi(e,t){const i=q(this,y,f).call(this,e,t);return i.getQueryData=this.getApiQueryData.bind(this,e),i.getQueriesData=this.getApiQueriesData.bind(this,e),i.setQueryData=(t,i)=>this.setApiQueryData(t,e,i),i.removeQueries=this.removeApiQueries.bind(this,e),i.invalidateQueries=this.invalidateApiQueries.bind(this,e),i.resetQueries=this.resetApiQueries.bind(this,e),i.refetchQueries=this.refetchApiQueries.bind(this,e),i.cancelQueries=this.cancelApiQueries.bind(this,e),i.isFetching=this.isFetching.bind(this,e),i.useIsFetching=this.useIsFetching.bind(void 0,e),Object.freeze(i)}createMutationApi(e,t,i=[]){const r=q(this,y,f).call(this,e,t);return r.relatedQueries=Object.freeze(i),r.refetchRelatedQueries=function(){return Promise.all(i.map((e=>e.refetchQueries())))},r.invalidateRelatedQueries=function(){return Promise.all(i.map((e=>e.invalidateQueries())))},r.isMutating=this.isMutating.bind(this,e),r.useIsMutating=this.useIsMutating.bind(void 0,e),Object.freeze(r)}getApiQueryData(e,t){return b(this,h).getQueryData(arguments.length>1?[e,t]:[e])}getApiQueriesData(e,t){return b(this,h).getQueriesData({queryKey:arguments.length>1?[e,t]:[e],type:"active",exact:!1})}setApiQueryData(e,t,i){b(this,h).setQueryData(arguments.length>2?[t,i]:[t],e)}removeApiQueries(e,t){b(this,h).removeQueries({type:"all",exact:!1,queryKey:arguments.length>1?[e,t]:[e]})}invalidateApiQueries(e,t){return b(this,h).invalidateQueries({queryKey:arguments.length>1?[e,t]:[e],type:"all",exact:!1,stale:!1,refetchType:"active"},{throwOnError:!1,cancelRefetch:!1})}resetApiQueries(e,t){return b(this,h).resetQueries({queryKey:arguments.length>1?[e,t]:[e],type:"active",exact:!1},{cancelRefetch:!0,throwOnError:!1})}refetchApiQueries(e,t){return b(this,h).refetchQueries({queryKey:arguments.length>1?[e,t]:[e],type:"active",exact:!1},{throwOnError:!1,cancelRefetch:!1})}cancelApiQueries(e,t){return b(this,h).cancelQueries({queryKey:arguments.length>1?[e,t]:[e],type:"active",exact:!1},{revert:!0,silent:!0})}isFetching(e,t){return b(this,h).isFetching({queryKey:arguments.length>1?[e,t]:[e],type:"active",exact:!1})>0}isMutating(e){return b(this,h).isMutating({mutationKey:[e],exact:!1})>0}}function k(e){return Object.freeze(new M(e))}h=new WeakMap,o=new WeakMap,l=new WeakMap,d=new WeakMap,y=new WeakSet,g=function(e){return e.data},p=function({isPending:e,isFetching:t,isLoading:i,isRefetching:r,isSuccess:s,isPlaceholderData:a,isError:n,isLoadingError:u,isRefetchError:c,isStale:h,error:o,data:l,refetch:d}){return{isPending:e,isSuccess:s,isError:n,isLoadingError:u,isRefetchError:c,isLoading:i,isFetching:t,isRefetching:r,isPlaceholderData:a,isStale:h,error:o??void 0,data:l,refetch:async()=>{const e=await d();return{isSuccess:e.isSuccess,isError:e.isError,error:e.error,data:e.data}}}},f=function(e,t){const i=t(b(this,l)),r=async(e,t)=>(w(this,d,t?.signal),await i(e));return r.key=e,r};export{M as ApiClient,k as createApiClient};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,137 @@
1
+ import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools";
2
+ import { type ChildrenProps, type DataDictionaryQueryApi, type MutationApi, type QueryApi } from "@vef-framework/shared";
3
+ import { type FC } from "react";
4
+ import type { ApiClient } from "./api-client";
5
+ /**
6
+ * The API context provider props.
7
+ */
8
+ export interface ApiContextProviderProps extends ChildrenProps {
9
+ /**
10
+ * The API client.
11
+ */
12
+ client: Readonly<ApiClient>;
13
+ /**
14
+ * The query API for the data dictionary.
15
+ */
16
+ dataDictionaryQueryApi?: Readonly<DataDictionaryQueryApi>;
17
+ }
18
+ /**
19
+ * The API context.
20
+ */
21
+ export interface ApiContext {
22
+ /**
23
+ * The useApiQuery hook.
24
+ */
25
+ useApiQuery: ApiClient["useApiQuery"];
26
+ /**
27
+ * The useApiMutation hook.
28
+ */
29
+ useApiMutation: ApiClient["useApiMutation"];
30
+ /**
31
+ * The useIsFetching hook.
32
+ */
33
+ useIsFetching: ApiClient["useIsFetching"];
34
+ /**
35
+ * The useIsMutating hook.
36
+ */
37
+ useIsMutating: ApiClient["useIsMutating"];
38
+ /**
39
+ * The fetchApiQuery function.
40
+ */
41
+ fetchApiQuery: ApiClient["fetchApiQuery"];
42
+ /**
43
+ * The create query API function.
44
+ */
45
+ createQueryApi: ApiClient["createQueryApi"];
46
+ /**
47
+ * The create mutation API function.
48
+ */
49
+ createMutationApi: ApiClient["createMutationApi"];
50
+ /**
51
+ * The get query API data function.
52
+ */
53
+ getApiQueryData: ApiClient["getApiQueryData"];
54
+ /**
55
+ * The get query APIs data function.
56
+ */
57
+ getApiQueriesData: ApiClient["getApiQueriesData"];
58
+ /**
59
+ * The set query API data function.
60
+ */
61
+ setApiQueryData: ApiClient["setApiQueryData"];
62
+ /**
63
+ * The remove API queries function.
64
+ */
65
+ removeApiQueries: ApiClient["removeApiQueries"];
66
+ /**
67
+ * The invalidate API queries function.
68
+ */
69
+ invalidateApiQueries: ApiClient["invalidateApiQueries"];
70
+ /**
71
+ * The reset API queries function.
72
+ */
73
+ resetApiQueries: ApiClient["resetApiQueries"];
74
+ /**
75
+ * The refetch API queries function.
76
+ */
77
+ refetchApiQueries: ApiClient["refetchApiQueries"];
78
+ /**
79
+ * The cancel API queries function.
80
+ */
81
+ cancelApiQueries: ApiClient["cancelApiQueries"];
82
+ /**
83
+ * The is fetching function.
84
+ */
85
+ isFetching: ApiClient["isFetching"];
86
+ /**
87
+ * The is mutating function.
88
+ */
89
+ isMutating: ApiClient["isMutating"];
90
+ /**
91
+ * The stub query API.
92
+ */
93
+ stubQueryApi: Readonly<QueryApi<any, any>>;
94
+ /**
95
+ * The async function query API.
96
+ */
97
+ asyncFnQueryApi: Readonly<QueryApi<AsyncFnParams, any>>;
98
+ /**
99
+ * The stub mutation API.
100
+ */
101
+ stubMutationApi: Readonly<MutationApi<any, any>>;
102
+ /**
103
+ * The async function mutation API.
104
+ */
105
+ asyncFnMutationApi: Readonly<MutationApi<AsyncFnParams, any>>;
106
+ /**
107
+ * The query API for the data dictionary.
108
+ */
109
+ dataDictionaryQueryApi?: Readonly<DataDictionaryQueryApi>;
110
+ }
111
+ /**
112
+ * The async function params.
113
+ */
114
+ export interface AsyncFnParams {
115
+ /**
116
+ * The key.
117
+ */
118
+ key: string;
119
+ /**
120
+ * The arguments.
121
+ */
122
+ args: any[];
123
+ /**
124
+ * The function.
125
+ */
126
+ fn: (...args: any[]) => Promise<any>;
127
+ }
128
+ /**
129
+ * The API context provider.
130
+ */
131
+ declare const ApiContextProvider: FC<ApiContextProviderProps>;
132
+ /**
133
+ * The use API context hook.
134
+ */
135
+ declare function useApiContext(): Readonly<ApiContext>;
136
+ declare const ApiQueryDevtools: typeof ReactQueryDevtoolsPanel;
137
+ export { ApiContextProvider, ApiQueryDevtools, useApiContext, };
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{ReactQueryDevtoolsPanel as e}from"@tanstack/react-query-devtools";import{VefError as i}from"@vef-framework/shared";import{createContext as t,useMemo as a,createElement as r,useContext as n}from"react";const u=t(null),s=({client:e,dataDictionaryQueryApi:i,children:t})=>{const n=a((()=>{const t=e.createQueryApi("_vefStubQueryApi",(()=>async e=>({code:0,message:"ok",data:e}))),a=e.createQueryApi("_vefAsyncFnQueryApi",(()=>async({args:e,fn:i})=>({code:0,message:"ok",data:await i(...e)}))),r=e.createMutationApi("_vefStubMutationApi",(()=>async e=>({code:0,message:"ok",data:e}))),n=e.createMutationApi("_vefAsyncFnMutationApi",(()=>async({args:e,fn:i})=>({code:0,message:"ok",data:await i(...e)})));return Object.freeze({useApiQuery:e.useApiQuery,useApiMutation:e.useApiMutation,useIsFetching:e.useIsFetching,useIsMutating:e.useIsMutating,fetchApiQuery:e.fetchApiQuery.bind(e),createQueryApi:e.createQueryApi.bind(e),createMutationApi:e.createMutationApi.bind(e),getApiQueryData:e.getApiQueryData.bind(e),getApiQueriesData:e.getApiQueriesData.bind(e),setApiQueryData:e.setApiQueryData.bind(e),removeApiQueries:e.removeApiQueries.bind(e),invalidateApiQueries:e.invalidateApiQueries.bind(e),resetApiQueries:e.resetApiQueries.bind(e),refetchApiQueries:e.refetchApiQueries.bind(e),cancelApiQueries:e.cancelApiQueries.bind(e),isFetching:e.isFetching.bind(e),isMutating:e.isMutating.bind(e),stubQueryApi:t,asyncFnQueryApi:a,stubMutationApi:r,asyncFnMutationApi:n,dataDictionaryQueryApi:i})}),[e,i]);return r(u.Provider,{value:n},r(e.QueryClientProvider,{},t))};function c(){const e=n(u);if(null===e)throw new i(-1,"Api context not found: Please ensure useApiContext is called within an ApiContextProvider");return e}const o=e;export{s as ApiContextProvider,o as ApiQueryDevtools,c as useApiContext};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,3 @@
1
+ export { ApiClient, createApiClient, type ApiClientOptions, type QueryOptions, } from "./api-client";
2
+ export * from "./api-context";
3
+ export { useMutation } from "@tanstack/react-query";
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ export{ApiClient,createApiClient}from"./api-client.js";export{ApiContextProvider,ApiQueryDevtools,useApiContext}from"./api-context.js";export{useMutation}from"@tanstack/react-query";
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,27 @@
1
+ import type { VefError } from "@vef-framework/shared";
2
+ import { QueryClient } from "@tanstack/react-query";
3
+ declare module "@tanstack/react-query" {
4
+ interface Register {
5
+ defaultError: VefError;
6
+ }
7
+ }
8
+ /**
9
+ * The query client options.
10
+ */
11
+ export interface QueryClientOptions {
12
+ /**
13
+ * The stale time of the query client.
14
+ */
15
+ staleTime?: number;
16
+ /**
17
+ * The garbage collection time of the query client.
18
+ */
19
+ gcTime?: number;
20
+ }
21
+ /**
22
+ * Create a query client.
23
+ *
24
+ * @param options - The options of the query client.
25
+ * @returns The query client.
26
+ */
27
+ export declare function createQueryClient(options?: QueryClientOptions): QueryClient;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{QueryClient as e}from"@tanstack/react-query";function r(r){const t=r?.staleTime??1/0;return new e({defaultOptions:{queries:{networkMode:"always",staleTime:t,gcTime:r?.gcTime??6e5,retry:3,structuralSharing:!0,throwOnError:!1,refetchOnMount:!1,refetchOnReconnect:!0,refetchOnWindowFocus:!0},mutations:{networkMode:"always",gcTime:t,retry:!1,throwOnError:!1}}})}export{r as createQueryClient};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,85 @@
1
+ import type { GenericAbortSignal } from "axios";
2
+ import { type ApiResponse, type Consumer, type Except, type Mapper, type MaybeNullish, type ObjectType, type ObjectValue } from "@vef-framework/shared";
3
+ /**
4
+ * The request client options.
5
+ */
6
+ export interface RequestClientOptions {
7
+ baseUrl: string;
8
+ timeout?: number;
9
+ getAccessToken: () => MaybeNullish<string>;
10
+ }
11
+ /**
12
+ * The request options.
13
+ */
14
+ export interface RequestOptions<P extends ObjectType = ObjectValue> {
15
+ signal?: GenericAbortSignal;
16
+ params?: P;
17
+ onProgress?: Consumer<number>;
18
+ }
19
+ /**
20
+ * The request client.
21
+ */
22
+ export declare class RequestClient {
23
+ #private;
24
+ readonly options: RequestClientOptions;
25
+ constructor(options: RequestClientOptions);
26
+ /**
27
+ * Perform a GET request.
28
+ *
29
+ * @param url - The url.
30
+ * @param options - The request options.
31
+ * @returns The response data promise.
32
+ */
33
+ get<P extends ObjectType = ObjectValue, R = unknown>(url: string, options?: Except<RequestOptions<P>, "onProgress">): Promise<ApiResponse<R>>;
34
+ /**
35
+ * Perform a POST request.
36
+ *
37
+ * @param url - The url.
38
+ * @param data - The request data.
39
+ * @param options - The request options.
40
+ * @returns The response data promise.
41
+ */
42
+ post<D extends ObjectType = ObjectValue, R = unknown, P extends ObjectType = ObjectValue>(url: string, data?: D, options?: Except<RequestOptions<P>, "onProgress">): Promise<ApiResponse<R>>;
43
+ /**
44
+ * Perform a PUT request.
45
+ *
46
+ * @param url - The url.
47
+ * @param data - The request data.
48
+ * @param options - The request options.
49
+ * @returns The response data promise.
50
+ */
51
+ put<D extends ObjectType = ObjectValue, R = unknown, P extends ObjectType = ObjectValue>(url: string, data?: D, options?: Except<RequestOptions<P>, "onProgress">): Promise<ApiResponse<R>>;
52
+ /**
53
+ * Perform a DELETE request.
54
+ *
55
+ * @param url - The url.
56
+ * @param options - The request options.
57
+ * @returns The response data promise.
58
+ */
59
+ delete<P extends ObjectType = ObjectValue, R = unknown>(url: string, options?: Except<RequestOptions<P>, "onProgress">): Promise<ApiResponse<R>>;
60
+ /**
61
+ * Perform a file upload request.
62
+ *
63
+ * @param url - The url.
64
+ * @param data - The file data.
65
+ * @param options - The request options.
66
+ * @returns The response data promise.
67
+ */
68
+ upload<R = unknown, P extends ObjectType = ObjectValue>(url: string, data: FormData, options?: RequestOptions<P>): Promise<ApiResponse<R>>;
69
+ /**
70
+ * Perform a file download request.
71
+ *
72
+ * @param url - The url.
73
+ * @param options - The request options.
74
+ */
75
+ download<P extends ObjectType = ObjectValue>(url: string, options?: RequestOptions<P> & {
76
+ fileName?: string | Mapper<string, string>;
77
+ }): Promise<void>;
78
+ }
79
+ /**
80
+ * Create a request client.
81
+ *
82
+ * @param options - The options of the request client.
83
+ * @returns The request client.
84
+ */
85
+ export declare function createRequestClient(options: RequestClientOptions): Readonly<RequestClient>;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{isNullish as e,showWarningMessage as t,VefError as a,isString as s,showErrorMessage as r,isFunction as o}from"@vef-framework/shared";import n,{CanceledError as i}from"axios";import l from"qs";var c,p=e=>{throw TypeError(e)},d=(e,t,a)=>t.has(e)||p("Cannot "+a),m=(e,t,a)=>(d(e,t,"read from private field"),a?a.call(e):t.get(e));const u=/\{(\w+)\}/;class h{constructor(o){var h,f,g;this.options=o,h=this,(f=c).has(h)?p("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(h):f.set(h,g),((e,t,a,s)=>{d(e,t,"write to private field"),s?s.call(e,a):t.set(e,a)})(this,c,n.create({baseURL:o.baseUrl,timeout:o.timeout??3e4,headers:{"Content-Type":"application/json"},paramsSerializer:e=>l.stringify(e,{arrayFormat:"repeat",skipNulls:!0,charset:"utf-8"}),responseType:"json",validateStatus:()=>!0})),m(this,c).interceptors.request.use((t=>{const a=this.options.getAccessToken();a&&(t.headers.Authorization=`Bearer ${a}`);const s=t.url;return s&&u.test(s)&&(t.url=s.replace(u,((a,s)=>{const r=t.params?.[s];if(e(r))throw new Error(`Path parameter ${s} is nil`);return r}))),t})),m(this,c).interceptors.response.use((e=>{const{code:s,message:r}=e.data;return 0===s?e:(t(r),Promise.reject(new a(s,r)))}),(e=>{if(e instanceof i)return Promise.reject(e);const{response:t,message:o}=e;if(t?.data){const e=`处理请求响应信息异常:${o??"无"}`;return Promise.reject(new a(t.status,e))}{let t=o??(s(e)?e:"");if("Network Error"===t)t="接口连接异常可能原因:网络不通或存在跨域问题。";else if(t.includes("timeout"))t="接口请求超时";else if(t.includes("Request failed with status code")){t=`接口状态码异常:${o.substring(o.length-3)}`}else t="接口未知异常";return r(t),Promise.reject(new a(-1,t))}}))}async get(e,t){return(await m(this,c).get(e,{params:t?.params,signal:t?.signal})).data}async post(e,t,a){return(await m(this,c).post(e,t,{params:a?.params,signal:a?.signal})).data}async put(e,t,a){return(await m(this,c).put(e,t,{params:a?.params,signal:a?.signal})).data}async delete(e,t){return(await m(this,c).delete(e,{params:t?.params,signal:t?.signal})).data}async upload(e,t,a){return(await m(this,c).postForm(e,t,{params:a?.params,signal:a?.signal,onUploadProgress:o(a?.onProgress)?e=>{const t=e.lengthComputable?e.total??0:0,s=e.loaded,r=Math.round(s/t*100);a.onProgress?.(r)}:void 0})).data}async download(e,t){const{data:r,headers:n}=await m(this,c).get(e,{params:t?.params,responseType:"blob",onDownloadProgress:o(t?.onProgress)?e=>{const a=e.lengthComputable?e.total??0:0,s=e.loaded,r=Math.round(s/a*100);t.onProgress?.(r)}:void 0});let i=null;try{i=JSON.parse(await r.text())}catch{}if(i&&0!==i.code)throw new a(i.code,i.message);const l=n.get("content-disposition");if(s(l)){const e=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(l);if(e){const a=decodeURIComponent(e[1]),s=document.createElement("a");s.href=URL.createObjectURL(r),s.download=o(t?.fileName)?t.fileName(a):t?.fileName??a,s.click(),URL.revokeObjectURL(s.href)}}}}function f(e){return Object.freeze(new h(e))}c=new WeakMap;export{h as RequestClient,f as createRequestClient};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,29 @@
1
+ import { type Api, type ChildrenProps, type Mapper, type PermissionChecker } from "@vef-framework/shared";
2
+ import { type FC } from "react";
3
+ /**
4
+ * The props of the AuthContextProvider component.
5
+ */
6
+ export interface AuthContextProviderProps extends ChildrenProps {
7
+ /**
8
+ * The permission checker.
9
+ */
10
+ permissionChecker?: PermissionChecker;
11
+ }
12
+ /**
13
+ * The auth context.
14
+ */
15
+ export interface AuthContext {
16
+ /**
17
+ * The function to check the permission.
18
+ */
19
+ checkPermission: Mapper<string | Api<any, any>, boolean>;
20
+ }
21
+ /**
22
+ * The auth context provider.
23
+ */
24
+ declare const AuthContextProvider: FC<AuthContextProviderProps>;
25
+ /**
26
+ * The use auth context hook.
27
+ */
28
+ declare function useAuthContext(): AuthContext;
29
+ export { AuthContextProvider, useAuthContext, };
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{isString as e,VefError as r}from"@vef-framework/shared";import{createContext as t,useMemo as o,createElement as n,useContext as i}from"react";const s=t(null),u=({permissionChecker:r,children:t})=>{const i=o((()=>({checkPermission:t=>!r||(e(t)?r(t):r(t.key))})),[r]);return n(s.Provider,{value:i},t)};function c(){const e=i(s);if(null===e)throw new r(-1,"useAuthContext must be used within a AuthContextProvider");return e}export{u as AuthContextProvider,c as useAuthContext};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1 @@
1
+ export * from "./auth-context";
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ export{AuthContextProvider,useAuthContext}from"./auth-context.js";
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Tokens are strings that map to functions.
3
+ */
4
+ interface Tokens {
5
+ [index: string]: (...args: any[]) => any;
6
+ }
7
+ /**
8
+ * The compiler output, a function that adds the required tokens.
9
+ */
10
+ export interface ExpressionEvaluator {
11
+ (tokens?: Tokens): any;
12
+ provide: (bind: (names: string[]) => Tokens) => ExpressionEvaluator;
13
+ }
14
+ /**
15
+ * Compiles a logical string like `"a != z || b == c"` into a single function.
16
+ * The return value is an object with a "provide" method that iterates over all
17
+ * requirement tokens to use as replacements.
18
+ *
19
+ * @example
20
+ *
21
+ * ```typescript
22
+ * let name = {
23
+ * value: 'jon'
24
+ * }
25
+ * const condition = compile("$name == 'bob'").provide((token) => {
26
+ * return () => name.value // must return a function!
27
+ * })
28
+ *
29
+ * condition() // false
30
+ * ```
31
+ *
32
+ * @param expr - An expression string to compile.
33
+ */
34
+ export declare function compile(expr: string): ExpressionEvaluator;
35
+ export {};
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{parseArgs as n,getAt as t,isQuotedString as e,rmEscapes as r}from"./helpers.js";function i(s){let l;const o=new Set,u=function(n,t){return"function"==typeof n?n(t):n},f=[{"&&":(n,t,e)=>u(n,e)&&u(t,e),"||":(n,t,e)=>u(n,e)||u(t,e)},{"===":(n,t,e)=>!(u(n,e)!==u(t,e)),"!==":(n,t,e)=>!(u(n,e)===u(t,e)),"==":(n,t,e)=>!(u(n,e)!=u(t,e)),"!=":(n,t,e)=>!(u(n,e)==u(t,e)),">=":(n,t,e)=>!!(u(n,e)>=u(t,e)),"<=":(n,t,e)=>!!(u(n,e)<=u(t,e)),">":(n,t,e)=>!!(u(n,e)>u(t,e)),"<":(n,t,e)=>!!(u(n,e)<u(t,e))},{"+":(n,t,e)=>u(n,e)+u(t,e),"-":(n,t,e)=>u(n,e)-u(t,e)},{"*":(n,t,e)=>u(n,e)*u(t,e),"/":(n,t,e)=>u(n,e)/u(t,e),"%":(n,t,e)=>u(n,e)%u(t,e)}],c=f.reduce(((n,t)=>n.concat(Object.keys(t))),[]),d=new Set(c.map((n=>n.charAt(0))));function g(n,t,e,r){const i=n.filter((n=>n.startsWith(t)));return!!i.length&&i.find((n=>{if(r.length>=e+n.length){if(r.substring(e,e+n.length)===n)return n}return!1}))}function h(n,t,e=1){let r=e?t.substring(n+1).trim():t.substring(0,n).trim();if(!r.length)return-1;if(!e){const n=r.split("").reverse(),t=n.findIndex((n=>d.has(n)));r=n.slice(t).join("")}const i=r[0];return f.findIndex((n=>!!g(Object.keys(n),i,0,r)))}function a(n,t){let e="";const r=t.length;let i=0;for(let s=n;s<r;s++){const n=t.charAt(s);if("("===n)i++;else if(")"===n)i--;else if(0===i&&" "===n)continue;if(0===i&&g(c,n,s,t))return[e,s-1];e+=n}return[e,t.length-1]}function b(n,t=0){const e=f[t],r=n.length,i=Object.keys(e);let s,l=0,o=!1,u=null,c="",d=null,b="",y="",m="",$="",j=0;const v=(n,t)=>{n?m+=t:c+=t};for(let f=0;f<r;f++)if(b=y,y=n.charAt(f),"'"!==y&&'"'!==y||"\\"===b||!(0===l&&!o||l&&!$))if(o&&(y!==o||"\\"===b)||$&&(y!==$||"\\"===b))v(l,y);else if(o!==y)if($!==y){if(" "!==y)if("("===y)0===l?j=f:m+=y,l++;else if(")"===y)if(l--,0===l){const e="string"==typeof c&&c.startsWith("$")?c:void 0,r=e&&"."===n.charAt(f+1);let i="";r&&([i,f]=a(f+2,n));const s=u?t:h(j,n,0),l=h(f,n);-1===s&&-1===l?(c=p(m,-1,e,i),"string"==typeof c&&(c=m)):u&&(s>=l||-1===l)&&t===s?(d=u.bind(null,p(m,-1,e,i)),u=null,c=""):l>s&&t===l?c=p(m,-1,e,i):c+=`(${m})${r?`.${i}`:""}`,m=""}else m+=y;else{if(0===l&&(s=g(i,y,f,n))){0===f&&console.error(103,[s,n]),f+=s.length-1,f===n.length-1&&console.error(104,[s,n]),u?c&&(d=u.bind(null,p(c,t)),u=e[s].bind(null,d),c=""):d?(u=e[s].bind(null,p(d,t)),d=null):(u=e[s].bind(null,p(c,t)),c="");continue}v(l,y)}}else $=!1,v(l,y);else o=!1,v(l,y);else l?$=y:o=y,v(l,y);return c&&u&&(u=u.bind(null,p(c,t))),u=!u&&d?d:u,!u&&c&&(u=(n,t)=>"function"==typeof n?n(t):n,u=u.bind(null,p(c,t))),u||c||console.error(105,n),u}function p(s,u,c,d){if(c){const e=p(c,f.length);let r,o=!!d&&i(`$${d}`);if("function"==typeof e){const i=n(String(s)).map((n=>p(n,-1)));return n=>{const s=e(n);return"function"!=typeof s?(console.warn(150,c),s):(r=s(...i.map((t=>"function"==typeof t?t(n):t))),o&&(o=o.provide((n=>{const e=l(n);return n.reduce(((n,i)=>{if(i===d||d?.startsWith(`${i}(`)){const e=t(r,i);n[i]=()=>e}else n[i]=e[i];return n}),{})}))),o?o():r)}}}else if("string"==typeof s){if("true"===s)return!0;if("false"===s)return!1;if("undefined"===s)return;if(e(s))return r(s.substring(1,s.length-1));if(!Number.isNaN(+s))return Number(s);if(u<f.length-1)return b(s,u+1);if(s.startsWith("$")){const n=s.substring(1);return o.add(n),function(t){return n in t?t[n]():void 0}}return s}return s}const y=b(s),m=Array.from(o);return Object.assign(y,{provide:function n(t){return l=t,Object.assign(y.bind(null,t(m)),{provide:n})}})}export{i as compile};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Checks if the given property exists on the given object.
3
+ *
4
+ * @param obj - An object to check.
5
+ * @param property - The property to check.
6
+ *
7
+ * @returns `boolean`
8
+ */
9
+ export declare function has(obj: {
10
+ [index: string]: any;
11
+ [index: number]: any;
12
+ }, property: string | symbol | number): boolean;
13
+ /**
14
+ * Get a specific value via dot notation.
15
+ *
16
+ * @param obj - An object to fetch data from.
17
+ * @param addr - An "address" in dot notation.
18
+ *
19
+ * @returns `unknown`
20
+ */
21
+ export declare function getAt(obj: any, addr: string): unknown;
22
+ /**
23
+ * Determine if the given string is fully quoted.
24
+ *
25
+ * @example
26
+ *
27
+ * ```javascript
28
+ * hello - false
29
+ * "hello" - true
30
+ * 'world' - true
31
+ * "hello"=="world" - false
32
+ * "hello'this'" - false
33
+ * "hello"'there' - false
34
+ * "hello""there" - false
35
+ * 'hello === world' - true
36
+ * ```
37
+ *
38
+ * @param str - The string to check.
39
+ *
40
+ * @returns `boolean`
41
+ */
42
+ export declare function isQuotedString(str: string): boolean;
43
+ /**
44
+ * Parse a string for comma-separated arguments.
45
+ *
46
+ * @param str - String to parse arguments from.
47
+ *
48
+ * @returns `string[]`
49
+ */
50
+ export declare function parseArgs(str: string): string[];
51
+ /**
52
+ * Remove extra escape characters.
53
+ *
54
+ * @param str - String to remove extra escape characters from.
55
+ *
56
+ * @returns `string`
57
+ */
58
+ export declare function rmEscapes(str: string): string;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ function t(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function n(n,r){if(!n||"object"!=typeof n)return null;const e=r.split(".");let o=n;for(const n in e){const r=e[n];if(t(o,r)&&(o=o[r]),+n==e.length-1)return o;if(!o||"object"!=typeof o)return null}return null}function r(t){if('"'!==t[0]&&"'"!==t[0])return!1;if(t[0]!==t[t.length-1])return!1;const n=t[0];for(let r=1;r<t.length;r++)if(t[r]===n&&(1===r||"\\"!==t[r-1])&&r!==t.length-1)return!1;return!0}function e(t){const n=[];let r="",e=0,o="",l="";for(let u=0;u<t.length;u++){const c=t.charAt(u);c===o&&"\\"!==l?o="":"'"!==c&&'"'!==c||o||"\\"===l?"("!==c||o?")"!==c||o||e--:e++:o=c,","!==c||o||0!==e?(" "!==c||o)&&(r+=c):(n.push(r),r=""),l=c}return r&&n.push(r),n}function o(t){if(!t.length)return"";let n="",r="";for(let e=0;e<t.length;e++){const o=t.charAt(e);"\\"===o&&"\\"!==r||(n+=o),r=o}return n}export{n as getAt,t as has,r as isQuotedString,e as parseArgs,o as rmEscapes};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,3 @@
1
+ export * from "./api";
2
+ export * from "./auth";
3
+ export { compile } from "./expr/compiler";
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import"./api/index.js";import"./auth/index.js";export{compile}from"./expr/compiler.js";export{ApiClient,createApiClient}from"./api/api-client.js";export{useMutation}from"@tanstack/react-query";export{ApiContextProvider,ApiQueryDevtools,useApiContext}from"./api/api-context.js";export{AuthContextProvider,useAuthContext}from"./auth/auth-context.js";
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,22 @@
1
+ /**
2
+ * All Middleware conform to the pattern of accepting a payload and a
3
+ * `next()` function. They can either pass the payload to the next middleware
4
+ * explicitly (as an argument of next), or implicitly (no argument for next).
5
+ */
6
+ export type Middleware<T = unknown> = (payload: T, next: (payload: T) => T) => T;
7
+ /**
8
+ * The Dispatcher interface is responsible creating/running "hooks".
9
+ */
10
+ export interface Dispatcher<T> {
11
+ (middleware: Middleware<T>): number;
12
+ unshift: (middleware: Middleware<T>) => number;
13
+ remove: (middleware: Middleware<T>) => void;
14
+ dispatch: (payload: T) => T;
15
+ }
16
+ /**
17
+ * Creates a new dispatcher that allows the addition/removal of middleware
18
+ * functions, and the ability to dispatch a payload to all middleware.
19
+ *
20
+ * @returns Dispatcher
21
+ */
22
+ export default function createDispatcher<T>(): Dispatcher<T>;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ function t(){const t=[];let n=0;const e=n=>t.push(n),s=e=>{const o=t[n];return"function"==typeof o?o(e,(t=>(n++,s(t)))):(n=0,e)};return e.dispatch=s,e.unshift=n=>t.unshift(n),e.remove=n=>{const e=t.indexOf(n);e>-1&&t.splice(e,1)},e}export{t as default};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@vef-framework/core",
3
+ "type": "module",
4
+ "version": "1.0.5",
5
+ "private": false,
6
+ "description": "The core of the VEF framework",
7
+ "author": "Venus",
8
+ "keywords": [
9
+ "vef",
10
+ "vef-framework",
11
+ "vef-core"
12
+ ],
13
+ "main": "dist/index.js",
14
+ "types": "dist/index.d.ts",
15
+ "files": [
16
+ "*"
17
+ ],
18
+ "engines": {
19
+ "node": ">=20"
20
+ },
21
+ "scripts": {
22
+ "build": "pnpm clean && tsx build.ts",
23
+ "clean": "rimraf dist"
24
+ },
25
+ "peerDependencies": {
26
+ "react": "18.3.1",
27
+ "react-dom": "18.3.1",
28
+ "zustand": "5.0.1"
29
+ },
30
+ "dependencies": {
31
+ "@emotion/cache": "11.13.5",
32
+ "@emotion/react": "11.13.5",
33
+ "@emotion/styled": "11.13.5",
34
+ "antd": "5.22.3",
35
+ "tslib": "2.8.1",
36
+ "@tanstack/react-query": "5.62.0",
37
+ "@tanstack/react-query-devtools": "5.62.0",
38
+ "@vef-framework/shared": "1.0.5",
39
+ "axios": "1.7.8",
40
+ "qs": "6.13.1"
41
+ },
42
+ "devDependencies": {
43
+ "@types/qs": "6.9.17"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
+ }