easy-soft-dva 3.10.76 → 3.10.77
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 +34 -34
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{logDevelop as i,isObject as e,promptTextBuilder as a,checkObjectIsNullOrEmpty as n,
|
|
1
|
+
import t from"react";import{logDevelop as i,isObject as e,promptTextBuilder as a,checkObjectIsNullOrEmpty as n,getModelCollection as o,isArray as l,tryDoDvaPrepareWork as r,logException as p,getModelNameList as c,checkInCollection as s,logDebug 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){return d("easy-soft-dva",u(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:""),y)}const y="dvaAssist",C={application:null,initialOption:{initialState:{},models:[]},initialOptionSetComplete:!1,applicationInitializeComplete:!1};function g(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(C.initialOptionSetComplete)return void i(b("setApplicationInitialOption"),"reset is not allowed, it can be set only once");if(!e(t))throw new Error(b("setApplicationInitialOption",a.buildMustObject({})));const r=t||{};n(r)?i("application initial option","empty"):i(r,"application initial option"),r.models=l(r.models)?[...r.models,...o()]:o(),C.initialOption=r,C.initialOptionSetComplete=!0}function x(){if(!C.initialOptionSetComplete)throw new Error(b("initializeApplication","please exec setApplicationInitialOption to set application initial option"));if(null!=C.application&&C.applicationInitializeComplete)return;r(),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(),i(b("initializeApplication","dva app start complete")),C.application.getStore=()=>C.application._store,C.application.use({onError(t){p(t)}}),C.application.dispatch=C.application._store.dispatch,C.applicationInitializeComplete=!0}function O(){if(!C.applicationInitializeComplete)throw new Error(b("getStore","please exec initializeApplication to start application before get store"))}function v(){return O(),C.application}function E(){return O(),C.application._store}function S(){return O(),C.application.dispatch}function k(t){let{type:i,payload:e={},alias:a="data",pretreatmentSuccessCallback:o=null,pretreatmentFailCallback:l=null}=t;if(n(i))throw new Error(b("dispatch","parameter type must be string and not allow empty"));const r=i.split("/");if(2!=r.length)throw new Error(b("dispatch",'parameter type must be like "modelName/effect"'));const p=r[0],d=c();if(!s(d.split(","),p))throw new Error(b("dispatch",`model ${p} do not exist, current models is "${d}"`));const u=S();return m(`model access: ${i}`),u({type:i,payload:e,alias:a,pretreatmentSuccessCallback:o||null,pretreatmentFailCallback:l||null})}function z(t){let{model:i,effect:e,payload:a={},alias:o="data",pretreatmentSuccessCallback:l=null,pretreatmentFailCallback:r=null}=t;if(n(i))throw new Error(b("dispatch","parameter model must be string and not allow empty"));if(n(e))throw new Error(b("dispatch","parameter effect must be string and not allow empty"));return k({type:`${i}/${e}`,payload:a,alias:o,pretreatmentSuccessCallback:l||null,pretreatmentFailCallback:r||null})}function A(){return v()._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:E()},i.children);export{F as ApplicationProvider,C as applicationAssist,k as dispatch,z as dispatchModel,A as getAllModel,S as getDispatch,v as getDvaApplication,I as getModel,j as getModelRemoteData,$ as getModelState,E as getStore,x as initializeApplication,g 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.77",
|
|
4
4
|
"description": "The core lightweight library for dva, based on redux and redux-saga.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build:rollup": "npx easy-soft-develop rimraf --path ./es && rollup --config rollup.config.compression.js --bundleConfigAsCjs",
|
|
16
|
-
"postbuild:rollup": "npm run z:tsc:build",
|
|
17
16
|
"build:rollup:skipCompression": "npx easy-soft-develop rimraf --path ./es && rollup --config rollup.config.skipCompression.js --bundleConfigAsCjs",
|
|
17
|
+
"postbuild:rollup": "npm run z:tsc:build",
|
|
18
18
|
"postbuild:rollup:skipCompression": "npm run z:tsc:build",
|
|
19
19
|
"dev:rollup": "rollup --config rollup.config.skipCompression.js --bundleConfigAsCjs --watch --watch.onBundleEnd=\"npm run z:tsc:build\"",
|
|
20
20
|
"precommit": "npm run z:lint:staged:quiet",
|
|
21
|
+
"prez:jsdoc:generate": "npm run z:jsdoc:clear",
|
|
21
22
|
"z:auto:adjust:file": "npm run z:jsdoc:generate",
|
|
22
23
|
"z:jsdoc:clear": "npx easy-soft-develop rimraf --path ./docs",
|
|
23
|
-
"prez:jsdoc:generate": "npm run z:jsdoc:clear",
|
|
24
24
|
"z:jsdoc:generate": "npx jsdoc -c .jsdoc.js",
|
|
25
25
|
"z:lint:file:all": "npm run z:lint:script:all && npm run z:lint:style:all",
|
|
26
26
|
"z:lint:file:all:fix": "npm run z:lint:script:all:fix && npm run z:lint:style:all:fix",
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
"z:lint:file:change:fix": "npm run z:lint:script:change:fix && npm run z:lint:style:all:fix",
|
|
29
29
|
"z:lint:script:all": "npx eslint --ext .js,.jsx,.ts,.tsx ./src",
|
|
30
30
|
"z:lint:script:all:fix": "npx eslint --fix --ext .js,.jsx,.ts,.tsx ./src",
|
|
31
|
-
"postz:lint:script:all:fix": "npm run z:prettier:format:all",
|
|
32
31
|
"z:lint:script:change": "npx eslint --cache --ext .js,.jsx,.ts,.tsx ./src",
|
|
33
32
|
"z:lint:script:change:fix": "npx eslint --fix --cache --ext .js,.jsx,.ts,.tsx ./src",
|
|
34
|
-
"postz:lint:script:change:fix": "npm run z:prettier:format:change",
|
|
35
33
|
"z:lint:staged": "npx lint-staged",
|
|
36
34
|
"z:lint:staged:quiet": "npx lint-staged --quiet",
|
|
37
35
|
"z:lint:style:all": "npx stylelint --allow-empty-input \"./src/**/*.{css,scss,less}\"",
|
|
38
36
|
"z:lint:style:all:fix": "npx stylelint --allow-empty-input --fix \"./src/**/*.{css,scss,less}\"",
|
|
39
|
-
"postz:lint:style:all:fix": "npm run z:prettier:format:all",
|
|
40
37
|
"z:lint:style:change": "npx stylelint --allow-empty-input --cache \"./src/**/*.{css,scss,less}\"",
|
|
41
38
|
"z:lint:style:change:fix": "npx stylelint --allow-empty-input --cache --fix \"./src/**/*.{css,scss,less}\"",
|
|
42
|
-
"postz:lint:style:change:fix": "npm run z:prettier:format:change",
|
|
43
39
|
"z:prettier:format:all": "npx prettier --write .",
|
|
44
40
|
"z:prettier:format:change": "npx prettier --cache --write .",
|
|
45
41
|
"z:prettier:package.json": "npx prettier --write ./package.json",
|
|
46
42
|
"z:test": "cross-env NODE_ENV=test jest",
|
|
47
|
-
"z:tsc:build": "echo show tsc version and create declaration file && tsc -v && tsc -p ./tsconfig.types.json && echo declaration file generate complete"
|
|
43
|
+
"z:tsc:build": "echo show tsc version and create declaration file && tsc -v && tsc -p ./tsconfig.types.json && echo declaration file generate complete",
|
|
44
|
+
"postz:lint:script:all:fix": "npm run z:prettier:format:all",
|
|
45
|
+
"postz:lint:script:change:fix": "npm run z:prettier:format:change",
|
|
46
|
+
"postz:lint:style:all:fix": "npm run z:prettier:format:all",
|
|
47
|
+
"postz:lint:style:change:fix": "npm run z:prettier:format:change"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@babel/runtime": "^7.26.
|
|
51
|
-
"@reduxjs/toolkit": "^2.5.
|
|
50
|
+
"@babel/runtime": "^7.26.7",
|
|
51
|
+
"@reduxjs/toolkit": "^2.5.1",
|
|
52
52
|
"easy-soft-utility": "workspace:*",
|
|
53
53
|
"flatten": "^1.0.3",
|
|
54
54
|
"global": "^4.4.0",
|
|
@@ -62,18 +62,18 @@
|
|
|
62
62
|
"warning": "^4.0.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@babel/core": "^7.26.
|
|
66
|
-
"@babel/eslint-parser": "^7.
|
|
65
|
+
"@babel/core": "^7.26.7",
|
|
66
|
+
"@babel/eslint-parser": "^7.26.5",
|
|
67
67
|
"@babel/plugin-external-helpers": "^7.25.9",
|
|
68
68
|
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
69
69
|
"@babel/plugin-transform-class-properties": "^7.25.9",
|
|
70
70
|
"@babel/plugin-transform-runtime": "^7.25.9",
|
|
71
|
-
"@babel/preset-env": "^7.26.
|
|
71
|
+
"@babel/preset-env": "^7.26.7",
|
|
72
72
|
"@babel/preset-react": "^7.26.3",
|
|
73
|
-
"@babel/runtime": "^7.26.
|
|
74
|
-
"@changesets/cli": "^2.27.
|
|
75
|
-
"@commitlint/cli": "^19.
|
|
76
|
-
"@commitlint/config-conventional": "^19.
|
|
73
|
+
"@babel/runtime": "^7.26.7",
|
|
74
|
+
"@changesets/cli": "^2.27.12",
|
|
75
|
+
"@commitlint/cli": "^19.7.1",
|
|
76
|
+
"@commitlint/config-conventional": "^19.7.1",
|
|
77
77
|
"@commitlint/config-pnpm-scopes": "^19.5.0",
|
|
78
78
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
|
|
79
79
|
"@rollup/plugin-alias": "^5.1.1",
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
"@svgr/rollup": "^8.1.0",
|
|
89
89
|
"@types/fs-extra": "^11.0.4",
|
|
90
90
|
"@types/jest": "^29.5.14",
|
|
91
|
-
"@types/node": "^22.
|
|
92
|
-
"@types/react": "^19.0.
|
|
93
|
-
"@types/react-dom": "^19.0.
|
|
91
|
+
"@types/node": "^22.13.1",
|
|
92
|
+
"@types/react": "^19.0.8",
|
|
93
|
+
"@types/react-dom": "^19.0.3",
|
|
94
94
|
"@types/shelljs": "^0.8.15",
|
|
95
|
-
"@typescript-eslint/parser": "^8.
|
|
95
|
+
"@typescript-eslint/parser": "^8.23.0",
|
|
96
96
|
"autoprefixer": "^10.4.20",
|
|
97
97
|
"babel-jest": "^29.7.0",
|
|
98
98
|
"commitizen": "^4.3.1",
|
|
@@ -101,47 +101,47 @@
|
|
|
101
101
|
"cssnano": "^7.0.6",
|
|
102
102
|
"cz-git": "^1.11.0",
|
|
103
103
|
"docdash": "^2.0.2",
|
|
104
|
-
"easy-soft-develop": "^2.1.
|
|
104
|
+
"easy-soft-develop": "^2.1.254",
|
|
105
105
|
"eslint": "^8.57.0",
|
|
106
106
|
"eslint-config-airbnb": "^19.0.4",
|
|
107
107
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
108
|
-
"eslint-config-prettier": "^
|
|
108
|
+
"eslint-config-prettier": "^10.0.1",
|
|
109
109
|
"eslint-formatter-pretty": "^6.0.1",
|
|
110
110
|
"eslint-import-resolver-typescript": "^3.7.0",
|
|
111
111
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
112
112
|
"eslint-plugin-import": "^2.31.0",
|
|
113
|
-
"eslint-plugin-jest": "^28.
|
|
113
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
114
114
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
115
|
-
"eslint-plugin-prettier": "^5.2.
|
|
115
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
116
116
|
"eslint-plugin-promise": "^7.2.1",
|
|
117
|
-
"eslint-plugin-react": "^7.37.
|
|
117
|
+
"eslint-plugin-react": "^7.37.4",
|
|
118
118
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
119
119
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
120
120
|
"eslint-plugin-unicorn": "^52.0.0",
|
|
121
121
|
"husky": "^9.1.7",
|
|
122
122
|
"jest": "^29.7.0",
|
|
123
123
|
"jsdoc": "^4.0.4",
|
|
124
|
-
"lint-staged": "^15.3
|
|
125
|
-
"mm": "^4.0.
|
|
126
|
-
"npm-check-updates": "^17.1.
|
|
124
|
+
"lint-staged": "^15.4.3",
|
|
125
|
+
"mm": "^4.0.2",
|
|
126
|
+
"npm-check-updates": "^17.1.14",
|
|
127
127
|
"prettier": "^3.4.2",
|
|
128
128
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
129
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
129
|
+
"prettier-plugin-packagejson": "^2.5.8",
|
|
130
130
|
"react-refresh": "^0.16.0",
|
|
131
131
|
"rimraf": "^6.0.1",
|
|
132
|
-
"rollup": "^4.
|
|
132
|
+
"rollup": "^4.34.4",
|
|
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.8.5",
|
|
139
|
-
"stylelint": "^16.
|
|
139
|
+
"stylelint": "^16.14.1",
|
|
140
140
|
"stylelint-config-css-modules": "^4.4.0",
|
|
141
|
-
"stylelint-config-standard": "^
|
|
141
|
+
"stylelint-config-standard": "^37.0.0",
|
|
142
142
|
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
|
|
143
143
|
"stylelint-order": "^6.0.4",
|
|
144
|
-
"terminal-kit": "^3.1.
|
|
144
|
+
"terminal-kit": "^3.1.2"
|
|
145
145
|
},
|
|
146
146
|
"peerDependencies": {
|
|
147
147
|
"redux": "4.x"
|