easy-soft-dva 3.10.106 → 3.10.108
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/es/index.js +1 -1
- package/package.json +19 -19
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{
|
|
1
|
+
import t from"react";import{checkObjectIsNullOrEmpty as i,getModelNameList as e,checkInCollection as a,logDebug as n,tryDoDvaPrepareWork as o,logDevelop as l,logException as r,isObject as p,promptTextBuilder as c,isArray as s,getModelCollection as m,buildPromptModuleInfo as d,mergeTextMessage as u}from"easy-soft-utility";import{create as f}from"./dva-core/index.js";import{createLoading as w}from"./dva-loading/index.js";import{Provider as h}from"react-redux";export{Provider,connect}from"react-redux";import"invariant";import"redux";import"redux-saga";import"is-plain-object";import"flatten";import"@reduxjs/toolkit";import"warning";function b(t,i=""){return d("easy-soft-dva",u(t,i),y)}const y="dvaAssist",C={application:null,initialOption:{initialState:{},models:[]},initialOptionSetComplete:!1,applicationInitializeComplete:!1};function x(t={}){if(C.initialOptionSetComplete)return void l(b("setApplicationInitialOption"),"reset is not allowed, it can be set only once");if(!p(t))throw new Error(b("setApplicationInitialOption",c.buildMustObject({})));const e=t||{};i(e)?l("application initial option","empty"):l(e,"application initial option"),e.models=s(e.models)?[...e.models,...m()]:m(),C.initialOption=e,C.initialOptionSetComplete=!0}function O(){if(!C.initialOptionSetComplete)throw new Error(b("initializeApplication","please exec setApplicationInitialOption to set application initial option"));if(null!=C.application&&C.applicationInitializeComplete)return;o(),C.application=f(C.initialOption),C.application.use(w({}));const{models:t=[]}={models:[],...C.initialOption};for(const i of t)C.application.model(i);C.application.start(),l(b("initializeApplication","dva app start complete")),C.application.getStore=()=>C.application._store,C.application.use({onError(t){r(t)}}),C.application.dispatch=C.application._store.dispatch,C.applicationInitializeComplete=!0}function g(){if(!C.applicationInitializeComplete)throw new Error(b("getStore","please exec initializeApplication to start application before get store"))}function E(){return g(),C.application}function S(){return g(),C.application._store}function k(){return g(),C.application.dispatch}function v({type:t,payload:o={},alias:l="data",pretreatmentSuccessCallback:r=null,pretreatmentFailCallback:p=null}){if(i(t))throw new Error(b("dispatch","parameter type must be string and not allow empty"));const c=t.split("/");if(2!=c.length)throw new Error(b("dispatch",'parameter type must be like "modelName/effect"'));const s=c[0],m=e();if(!a(m.split(","),s))throw new Error(b("dispatch",`model ${s} do not exist, current models is "${m}"`));const d=k();return n(`model access: ${t}`),d({type:t,payload:o,alias:l,pretreatmentSuccessCallback:r||null,pretreatmentFailCallback:p||null})}function z({model:t,effect:e,payload:a={},alias:n="data",pretreatmentSuccessCallback:o=null,pretreatmentFailCallback:l=null}){if(i(t))throw new Error(b("dispatch","parameter model must be string and not allow empty"));if(i(e))throw new Error(b("dispatch","parameter effect must be string and not allow empty"));return v({type:`${t}/${e}`,payload:a,alias:n,pretreatmentSuccessCallback:o||null,pretreatmentFailCallback:l||null})}function A(){return E()._models}function I(t){const i=A(),e=i.filter(i=>i.namespace===t);if(e.length>0)return e[0];throw new Error(`${t} not in dva models, current models is ${i.map(t=>t.namespace).join(",")}`)}function $(t){return I(t).state}function j(t){const{data:i}={data:{},...$(t)};return i||{}}const F=i=>t.createElement(h,{store:S()},i.children);export{F as ApplicationProvider,C as applicationAssist,v as dispatch,z as dispatchModel,A as getAllModel,k as getDispatch,E as getDvaApplication,I as getModel,j as getModelRemoteData,$ as getModelState,S as getStore,O as initializeApplication,x as setApplicationInitialOption};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-soft-dva",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.108",
|
|
4
4
|
"description": "The core lightweight library for dva, based on redux and redux-saga.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -62,19 +62,19 @@
|
|
|
62
62
|
"warning": "^4.0.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@babel/core": "^7.
|
|
65
|
+
"@babel/core": "^7.29.0",
|
|
66
66
|
"@babel/eslint-parser": "^7.28.6",
|
|
67
67
|
"@babel/plugin-external-helpers": "^7.27.1",
|
|
68
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
68
|
+
"@babel/plugin-proposal-decorators": "^7.29.0",
|
|
69
69
|
"@babel/plugin-transform-class-properties": "^7.28.6",
|
|
70
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
71
|
-
"@babel/preset-env": "^7.
|
|
70
|
+
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
71
|
+
"@babel/preset-env": "^7.29.0",
|
|
72
72
|
"@babel/preset-react": "^7.28.5",
|
|
73
73
|
"@babel/runtime": "^7.28.6",
|
|
74
74
|
"@changesets/cli": "^2.29.8",
|
|
75
|
-
"@commitlint/cli": "^20.
|
|
76
|
-
"@commitlint/config-conventional": "^20.
|
|
77
|
-
"@commitlint/config-pnpm-scopes": "^20.
|
|
75
|
+
"@commitlint/cli": "^20.4.1",
|
|
76
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
77
|
+
"@commitlint/config-pnpm-scopes": "^20.4.0",
|
|
78
78
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
|
|
79
79
|
"@rollup/plugin-alias": "^6.0.0",
|
|
80
80
|
"@rollup/plugin-babel": "6.1.0",
|
|
@@ -88,12 +88,12 @@
|
|
|
88
88
|
"@svgr/rollup": "^8.1.0",
|
|
89
89
|
"@types/fs-extra": "^11.0.4",
|
|
90
90
|
"@types/jest": "^30.0.0",
|
|
91
|
-
"@types/node": "^25.
|
|
91
|
+
"@types/node": "^25.2.2",
|
|
92
92
|
"@types/react": "^18.3.1",
|
|
93
93
|
"@types/react-dom": "^18.3.1",
|
|
94
94
|
"@types/shelljs": "^0.10.0",
|
|
95
|
-
"@typescript-eslint/parser": "^8.
|
|
96
|
-
"autoprefixer": "^10.4.
|
|
95
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
96
|
+
"autoprefixer": "^10.4.24",
|
|
97
97
|
"babel-jest": "^30.2.0",
|
|
98
98
|
"commitizen": "^4.3.1",
|
|
99
99
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"cssnano": "^7.1.2",
|
|
102
102
|
"cz-git": "^1.12.0",
|
|
103
103
|
"docdash": "^2.0.2",
|
|
104
|
-
"easy-soft-develop": "^2.2.
|
|
104
|
+
"easy-soft-develop": "^2.2.19",
|
|
105
105
|
"eslint": "^8.57.0",
|
|
106
106
|
"eslint-config-airbnb": "^19.0.4",
|
|
107
107
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
111
111
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
112
112
|
"eslint-plugin-import": "^2.32.0",
|
|
113
|
-
"eslint-plugin-jest": "^29.
|
|
113
|
+
"eslint-plugin-jest": "^29.13.0",
|
|
114
114
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
115
115
|
"eslint-plugin-prettier": "^5.5.5",
|
|
116
116
|
"eslint-plugin-promise": "^7.2.1",
|
|
@@ -123,23 +123,23 @@
|
|
|
123
123
|
"jsdoc": "^4.0.5",
|
|
124
124
|
"lint-staged": "^16.2.7",
|
|
125
125
|
"mm": "^4.0.2",
|
|
126
|
-
"npm-check-updates": "^19.3.
|
|
127
|
-
"prettier": "^3.8.
|
|
126
|
+
"npm-check-updates": "^19.3.2",
|
|
127
|
+
"prettier": "^3.8.1",
|
|
128
128
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
129
129
|
"prettier-plugin-packagejson": "^3.0.0",
|
|
130
130
|
"react-refresh": "^0.18.0",
|
|
131
131
|
"rimraf": "^6.1.2",
|
|
132
|
-
"rollup": "^4.
|
|
132
|
+
"rollup": "^4.57.1",
|
|
133
133
|
"rollup-plugin-copy": "^3.5.0",
|
|
134
134
|
"rollup-plugin-livereload": "^2.0.5",
|
|
135
135
|
"rollup-plugin-postcss": "^4.0.2",
|
|
136
136
|
"rollup-plugin-serve": "^3.0.0",
|
|
137
137
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
138
138
|
"shelljs": "^0.10.0",
|
|
139
|
-
"stylelint": "^17.
|
|
140
|
-
"stylelint-config-css-modules": "^4.
|
|
139
|
+
"stylelint": "^17.1.1",
|
|
140
|
+
"stylelint-config-css-modules": "^4.6.0",
|
|
141
141
|
"stylelint-config-standard": "^40.0.0",
|
|
142
|
-
"stylelint-declaration-block-no-ignored-properties": "^
|
|
142
|
+
"stylelint-declaration-block-no-ignored-properties": "^3.0.0",
|
|
143
143
|
"stylelint-order": "^7.0.1",
|
|
144
144
|
"terminal-kit": "^3.1.2"
|
|
145
145
|
},
|