@zstackui/qiankun 2.6.3-beta-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.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -0
  3. package/dist/index.umd.js +8681 -0
  4. package/dist/index.umd.js.map +1 -0
  5. package/dist/index.umd.min.js +4 -0
  6. package/dist/index.umd.min.js.map +1 -0
  7. package/dist/src/__tests__/globalState.test.d.ts +5 -0
  8. package/dist/src/__tests__/utils.test.d.ts +1 -0
  9. package/dist/src/addons/engineFlag.d.ts +6 -0
  10. package/dist/src/addons/index.d.ts +6 -0
  11. package/dist/src/addons/runtimePublicPath.d.ts +6 -0
  12. package/dist/src/apis.d.ts +7 -0
  13. package/dist/src/effects.d.ts +3 -0
  14. package/dist/src/error.d.ts +3 -0
  15. package/dist/src/errorHandler.d.ts +7 -0
  16. package/dist/src/globalState.d.ts +7 -0
  17. package/dist/src/index.d.ts +11 -0
  18. package/dist/src/interfaces.d.ts +107 -0
  19. package/dist/src/loader.d.ts +8 -0
  20. package/dist/src/prefetch.d.ts +14 -0
  21. package/dist/src/sandbox/__tests__/common.test.d.ts +5 -0
  22. package/dist/src/sandbox/__tests__/proxySandbox.test.d.ts +10 -0
  23. package/dist/src/sandbox/common.d.ts +21 -0
  24. package/dist/src/sandbox/index.d.ts +40 -0
  25. package/dist/src/sandbox/legacy/__tests__/sandbox.test.d.ts +5 -0
  26. package/dist/src/sandbox/legacy/sandbox.d.ts +28 -0
  27. package/dist/src/sandbox/patchers/__tests__/css.test.d.ts +5 -0
  28. package/dist/src/sandbox/patchers/__tests__/interval.test.d.ts +5 -0
  29. package/dist/src/sandbox/patchers/css.d.ts +17 -0
  30. package/dist/src/sandbox/patchers/dynamicAppend/__tests__/common.test.d.ts +1 -0
  31. package/dist/src/sandbox/patchers/dynamicAppend/common.d.ts +22 -0
  32. package/dist/src/sandbox/patchers/dynamicAppend/forLooseSandbox.d.ts +17 -0
  33. package/dist/src/sandbox/patchers/dynamicAppend/forStrictSandbox.d.ts +12 -0
  34. package/dist/src/sandbox/patchers/dynamicAppend/index.d.ts +6 -0
  35. package/dist/src/sandbox/patchers/historyListener.d.ts +5 -0
  36. package/dist/src/sandbox/patchers/index.d.ts +9 -0
  37. package/dist/src/sandbox/patchers/interval.d.ts +5 -0
  38. package/dist/src/sandbox/patchers/windowListener.d.ts +5 -0
  39. package/dist/src/sandbox/proxySandbox.d.ts +23 -0
  40. package/dist/src/sandbox/snapshotSandbox.d.ts +20 -0
  41. package/dist/src/utils.d.ts +44 -0
  42. package/dist/src/version.d.ts +1 -0
  43. package/es/addons/engineFlag.d.ts +6 -0
  44. package/es/addons/engineFlag.js +50 -0
  45. package/es/addons/index.d.ts +6 -0
  46. package/es/addons/index.js +13 -0
  47. package/es/addons/runtimePublicPath.d.ts +6 -0
  48. package/es/addons/runtimePublicPath.js +57 -0
  49. package/es/apis.d.ts +7 -0
  50. package/es/apis.js +278 -0
  51. package/es/effects.d.ts +3 -0
  52. package/es/effects.js +33 -0
  53. package/es/error.d.ts +3 -0
  54. package/es/error.js +16 -0
  55. package/es/errorHandler.d.ts +7 -0
  56. package/es/errorHandler.js +13 -0
  57. package/es/globalState.d.ts +7 -0
  58. package/es/globalState.js +101 -0
  59. package/es/index.d.ts +11 -0
  60. package/es/index.js +11 -0
  61. package/es/interfaces.d.ts +107 -0
  62. package/es/interfaces.js +8 -0
  63. package/es/loader.d.ts +8 -0
  64. package/es/loader.js +600 -0
  65. package/es/prefetch.d.ts +14 -0
  66. package/es/prefetch.js +125 -0
  67. package/es/sandbox/common.d.ts +21 -0
  68. package/es/sandbox/common.js +157 -0
  69. package/es/sandbox/index.d.ts +40 -0
  70. package/es/sandbox/index.js +105 -0
  71. package/es/sandbox/legacy/sandbox.d.ts +28 -0
  72. package/es/sandbox/legacy/sandbox.js +142 -0
  73. package/es/sandbox/patchers/css.d.ts +17 -0
  74. package/es/sandbox/patchers/css.js +186 -0
  75. package/es/sandbox/patchers/dynamicAppend/common.d.ts +22 -0
  76. package/es/sandbox/patchers/dynamicAppend/common.js +306 -0
  77. package/es/sandbox/patchers/dynamicAppend/forLooseSandbox.d.ts +17 -0
  78. package/es/sandbox/patchers/dynamicAppend/forLooseSandbox.js +77 -0
  79. package/es/sandbox/patchers/dynamicAppend/forStrictSandbox.d.ts +12 -0
  80. package/es/sandbox/patchers/dynamicAppend/forStrictSandbox.js +103 -0
  81. package/es/sandbox/patchers/dynamicAppend/index.d.ts +6 -0
  82. package/es/sandbox/patchers/dynamicAppend/index.js +6 -0
  83. package/es/sandbox/patchers/historyListener.d.ts +5 -0
  84. package/es/sandbox/patchers/historyListener.js +54 -0
  85. package/es/sandbox/patchers/index.d.ts +9 -0
  86. package/es/sandbox/patchers/index.js +45 -0
  87. package/es/sandbox/patchers/interval.d.ts +5 -0
  88. package/es/sandbox/patchers/interval.js +34 -0
  89. package/es/sandbox/patchers/windowListener.d.ts +5 -0
  90. package/es/sandbox/patchers/windowListener.js +34 -0
  91. package/es/sandbox/proxySandbox.d.ts +23 -0
  92. package/es/sandbox/proxySandbox.js +315 -0
  93. package/es/sandbox/snapshotSandbox.d.ts +20 -0
  94. package/es/sandbox/snapshotSandbox.js +59 -0
  95. package/es/utils.d.ts +44 -0
  96. package/es/utils.js +215 -0
  97. package/es/version.d.ts +1 -0
  98. package/es/version.js +1 -0
  99. package/lib/addons/engineFlag.d.ts +6 -0
  100. package/lib/addons/engineFlag.js +55 -0
  101. package/lib/addons/index.d.ts +6 -0
  102. package/lib/addons/index.js +21 -0
  103. package/lib/addons/runtimePublicPath.d.ts +6 -0
  104. package/lib/addons/runtimePublicPath.js +63 -0
  105. package/lib/apis.d.ts +7 -0
  106. package/lib/apis.js +288 -0
  107. package/lib/effects.d.ts +3 -0
  108. package/lib/effects.js +42 -0
  109. package/lib/error.d.ts +3 -0
  110. package/lib/error.js +23 -0
  111. package/lib/errorHandler.d.ts +7 -0
  112. package/lib/errorHandler.js +33 -0
  113. package/lib/globalState.d.ts +7 -0
  114. package/lib/globalState.js +110 -0
  115. package/lib/index.d.ts +11 -0
  116. package/lib/index.js +89 -0
  117. package/lib/interfaces.d.ts +107 -0
  118. package/lib/interfaces.js +14 -0
  119. package/lib/loader.d.ts +8 -0
  120. package/lib/loader.js +606 -0
  121. package/lib/prefetch.d.ts +14 -0
  122. package/lib/prefetch.js +132 -0
  123. package/lib/sandbox/common.d.ts +21 -0
  124. package/lib/sandbox/common.js +169 -0
  125. package/lib/sandbox/index.d.ts +40 -0
  126. package/lib/sandbox/index.js +123 -0
  127. package/lib/sandbox/legacy/sandbox.d.ts +28 -0
  128. package/lib/sandbox/legacy/sandbox.js +148 -0
  129. package/lib/sandbox/patchers/css.d.ts +17 -0
  130. package/lib/sandbox/patchers/css.js +193 -0
  131. package/lib/sandbox/patchers/dynamicAppend/common.d.ts +22 -0
  132. package/lib/sandbox/patchers/dynamicAppend/common.js +322 -0
  133. package/lib/sandbox/patchers/dynamicAppend/forLooseSandbox.d.ts +17 -0
  134. package/lib/sandbox/patchers/dynamicAppend/forLooseSandbox.js +84 -0
  135. package/lib/sandbox/patchers/dynamicAppend/forStrictSandbox.d.ts +12 -0
  136. package/lib/sandbox/patchers/dynamicAppend/forStrictSandbox.js +110 -0
  137. package/lib/sandbox/patchers/dynamicAppend/index.d.ts +6 -0
  138. package/lib/sandbox/patchers/dynamicAppend/index.js +19 -0
  139. package/lib/sandbox/patchers/historyListener.d.ts +5 -0
  140. package/lib/sandbox/patchers/historyListener.js +62 -0
  141. package/lib/sandbox/patchers/index.d.ts +9 -0
  142. package/lib/sandbox/patchers/index.js +57 -0
  143. package/lib/sandbox/patchers/interval.d.ts +5 -0
  144. package/lib/sandbox/patchers/interval.js +42 -0
  145. package/lib/sandbox/patchers/windowListener.d.ts +5 -0
  146. package/lib/sandbox/patchers/windowListener.js +42 -0
  147. package/lib/sandbox/proxySandbox.d.ts +23 -0
  148. package/lib/sandbox/proxySandbox.js +321 -0
  149. package/lib/sandbox/snapshotSandbox.d.ts +20 -0
  150. package/lib/sandbox/snapshotSandbox.js +65 -0
  151. package/lib/utils.d.ts +44 -0
  152. package/lib/utils.js +240 -0
  153. package/lib/version.d.ts +1 -0
  154. package/lib/version.js +7 -0
  155. package/package.json +137 -0
package/lib/utils.js ADDED
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.genAppInstanceIdByName = exports.Deferred = void 0;
8
+ exports.getContainer = getContainer;
9
+ exports.getContainerXPath = getContainerXPath;
10
+ exports.getDefaultTplWrapper = getDefaultTplWrapper;
11
+ exports.getWrapperId = getWrapperId;
12
+ exports.getXPathForElement = getXPathForElement;
13
+ exports.isBoundedFunction = isBoundedFunction;
14
+ exports.isCallable = void 0;
15
+ exports.isConstructable = isConstructable;
16
+ exports.isEnableScopedCSS = isEnableScopedCSS;
17
+ exports.nativeGlobal = void 0;
18
+ exports.nextTask = nextTask;
19
+ exports.performanceGetEntriesByName = performanceGetEntriesByName;
20
+ exports.performanceMark = performanceMark;
21
+ exports.performanceMeasure = performanceMeasure;
22
+ exports.sleep = sleep;
23
+ exports.toArray = toArray;
24
+ exports.validateExportLifecycle = validateExportLifecycle;
25
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
26
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
27
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
28
+ var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
29
+ var _once2 = _interopRequireDefault(require("lodash/once"));
30
+ var _snakeCase2 = _interopRequireDefault(require("lodash/snakeCase"));
31
+ var _version = require("./version");
32
+ /**
33
+ * @author Kuitos
34
+ * @since 2019-05-15
35
+ */
36
+
37
+ function toArray(array) {
38
+ return Array.isArray(array) ? array : [array];
39
+ }
40
+ function sleep(ms) {
41
+ return new Promise(function (resolve) {
42
+ return setTimeout(resolve, ms);
43
+ });
44
+ }
45
+ // Promise.then might be synchronized in Zone.js context, we need to use setTimeout instead to mock next tick.
46
+ var nextTick = typeof window.Zone === 'function' ? setTimeout : function (cb) {
47
+ return Promise.resolve().then(cb);
48
+ };
49
+ var globalTaskPending = false;
50
+ /**
51
+ * Run a callback before next task executing, and the invocation is idempotent in every singular task
52
+ * That means even we called nextTask multi times in one task, only the first callback will be pushed to nextTick to be invoked.
53
+ * @param cb
54
+ */
55
+ function nextTask(cb) {
56
+ if (!globalTaskPending) {
57
+ globalTaskPending = true;
58
+ nextTick(function () {
59
+ cb();
60
+ globalTaskPending = false;
61
+ });
62
+ }
63
+ }
64
+ var fnRegexCheckCacheMap = new WeakMap();
65
+ function isConstructable(fn) {
66
+ // prototype methods might be changed while code running, so we need check it every time
67
+ var hasPrototypeMethods = fn.prototype && fn.prototype.constructor === fn && Object.getOwnPropertyNames(fn.prototype).length > 1;
68
+ if (hasPrototypeMethods) return true;
69
+ if (fnRegexCheckCacheMap.has(fn)) {
70
+ return fnRegexCheckCacheMap.get(fn);
71
+ }
72
+ /*
73
+ 1. 有 prototype 并且 prototype 上有定义一系列非 constructor 属性
74
+ 2. 函数名大写开头
75
+ 3. class 函数
76
+ 满足其一则可认定为构造函数
77
+ */
78
+ var constructable = hasPrototypeMethods;
79
+ if (!constructable) {
80
+ // fn.toString has a significant performance overhead, if hasPrototypeMethods check not passed, we will check the function string with regex
81
+ var fnString = fn.toString();
82
+ var constructableFunctionRegex = /^function\b\s[A-Z].*/;
83
+ var classRegex = /^class\b/;
84
+ constructable = constructableFunctionRegex.test(fnString) || classRegex.test(fnString);
85
+ }
86
+ fnRegexCheckCacheMap.set(fn, constructable);
87
+ return constructable;
88
+ }
89
+ /**
90
+ * in safari
91
+ * typeof document.all === 'undefined' // true
92
+ * typeof document.all === 'function' // true
93
+ * We need to discriminate safari for better performance
94
+ */
95
+ var naughtySafari = typeof document.all === 'function' && typeof document.all === 'undefined';
96
+ var callableFnCacheMap = new WeakMap();
97
+ var isCallable = exports.isCallable = function isCallable(fn) {
98
+ if (callableFnCacheMap.has(fn)) {
99
+ return true;
100
+ }
101
+ var callable = naughtySafari ? typeof fn === 'function' && typeof fn !== 'undefined' : typeof fn === 'function';
102
+ if (callable) {
103
+ callableFnCacheMap.set(fn, callable);
104
+ }
105
+ return callable;
106
+ };
107
+ var boundedMap = new WeakMap();
108
+ function isBoundedFunction(fn) {
109
+ if (boundedMap.has(fn)) {
110
+ return boundedMap.get(fn);
111
+ }
112
+ /*
113
+ indexOf is faster than startsWith
114
+ see https://jsperf.com/string-startswith/72
115
+ */
116
+ var bounded = fn.name.indexOf('bound ') === 0 && !fn.hasOwnProperty('prototype');
117
+ boundedMap.set(fn, bounded);
118
+ return bounded;
119
+ }
120
+ function getDefaultTplWrapper(name) {
121
+ return function (tpl) {
122
+ return "<div id=\"".concat(getWrapperId(name), "\" data-name=\"").concat(name, "\" data-version=\"").concat(_version.version, "\">").concat(tpl, "</div>");
123
+ };
124
+ }
125
+ function getWrapperId(name) {
126
+ return "__qiankun_microapp_wrapper_for_".concat((0, _snakeCase2.default)(name), "__");
127
+ }
128
+ var nativeGlobal = exports.nativeGlobal = new Function('return this')();
129
+ var getGlobalAppInstanceMap = (0, _once2.default)(function () {
130
+ if (!nativeGlobal.hasOwnProperty('__app_instance_name_map__')) {
131
+ Object.defineProperty(nativeGlobal, '__app_instance_name_map__', {
132
+ enumerable: false,
133
+ configurable: true,
134
+ writable: true,
135
+ value: {}
136
+ });
137
+ }
138
+ return nativeGlobal.__app_instance_name_map__;
139
+ });
140
+ /**
141
+ * Get app instance name with the auto-increment approach
142
+ * @param appName
143
+ */
144
+ var genAppInstanceIdByName = exports.genAppInstanceIdByName = function genAppInstanceIdByName(appName) {
145
+ var globalAppInstanceMap = getGlobalAppInstanceMap();
146
+ if (!(appName in globalAppInstanceMap)) {
147
+ nativeGlobal.__app_instance_name_map__[appName] = 0;
148
+ return appName;
149
+ }
150
+ globalAppInstanceMap[appName]++;
151
+ return "".concat(appName, "_").concat(globalAppInstanceMap[appName]);
152
+ };
153
+ /** 校验子应用导出的 生命周期 对象是否正确 */
154
+ function validateExportLifecycle(exports) {
155
+ var _ref = exports !== null && exports !== void 0 ? exports : {},
156
+ bootstrap = _ref.bootstrap,
157
+ mount = _ref.mount,
158
+ unmount = _ref.unmount;
159
+ return (0, _isFunction2.default)(bootstrap) && (0, _isFunction2.default)(mount) && (0, _isFunction2.default)(unmount);
160
+ }
161
+ var Deferred = exports.Deferred = /*#__PURE__*/(0, _createClass2.default)(function Deferred() {
162
+ var _this = this;
163
+ (0, _classCallCheck2.default)(this, Deferred);
164
+ this.promise = new Promise(function (resolve, reject) {
165
+ _this.resolve = resolve;
166
+ _this.reject = reject;
167
+ });
168
+ });
169
+ var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function' && typeof performance.getEntriesByName === 'function';
170
+ function performanceGetEntriesByName(markName, type) {
171
+ var marks = null;
172
+ if (supportsUserTiming) {
173
+ marks = performance.getEntriesByName(markName, type);
174
+ }
175
+ return marks;
176
+ }
177
+ function performanceMark(markName) {
178
+ if (supportsUserTiming) {
179
+ performance.mark(markName);
180
+ }
181
+ }
182
+ function performanceMeasure(measureName, markName) {
183
+ if (supportsUserTiming && performance.getEntriesByName(markName, 'mark').length) {
184
+ performance.measure(measureName, markName);
185
+ performance.clearMarks(markName);
186
+ performance.clearMeasures(measureName);
187
+ }
188
+ }
189
+ function isEnableScopedCSS(sandbox) {
190
+ if ((0, _typeof2.default)(sandbox) !== 'object') {
191
+ return false;
192
+ }
193
+ if (sandbox.strictStyleIsolation) {
194
+ return false;
195
+ }
196
+ return !!sandbox.experimentalStyleIsolation;
197
+ }
198
+ /**
199
+ * copy from https://developer.mozilla.org/zh-CN/docs/Using_XPath
200
+ * @param el
201
+ * @param document
202
+ */
203
+ function getXPathForElement(el, document) {
204
+ // not support that if el not existed in document yet(such as it not append to document before it mounted)
205
+ if (!document.body.contains(el)) {
206
+ return undefined;
207
+ }
208
+ var xpath = '';
209
+ var pos;
210
+ var tmpEle;
211
+ var element = el;
212
+ while (element !== document.documentElement) {
213
+ pos = 0;
214
+ tmpEle = element;
215
+ while (tmpEle) {
216
+ if (tmpEle.nodeType === 1 && tmpEle.nodeName === element.nodeName) {
217
+ // If it is ELEMENT_NODE of the same name
218
+ pos += 1;
219
+ }
220
+ tmpEle = tmpEle.previousSibling;
221
+ }
222
+ xpath = "*[name()='".concat(element.nodeName, "'][").concat(pos, "]/").concat(xpath);
223
+ element = element.parentNode;
224
+ }
225
+ xpath = "/*[name()='".concat(document.documentElement.nodeName, "']/").concat(xpath);
226
+ xpath = xpath.replace(/\/$/, '');
227
+ return xpath;
228
+ }
229
+ function getContainer(container) {
230
+ return typeof container === 'string' ? document.querySelector(container) : container;
231
+ }
232
+ function getContainerXPath(container) {
233
+ if (container) {
234
+ var containerElement = getContainer(container);
235
+ if (containerElement) {
236
+ return getXPathForElement(containerElement, document);
237
+ }
238
+ }
239
+ return undefined;
240
+ }
@@ -0,0 +1 @@
1
+ export declare const version = " 2.6.3-beta-5";
package/lib/version.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.version = void 0;
7
+ var version = exports.version = ' 2.6.3-beta-5';
package/package.json ADDED
@@ -0,0 +1,137 @@
1
+ {
2
+ "name": "@zstackui/qiankun",
3
+ "version": " 2.6.3-beta-5",
4
+ "description": "A completed implementation of Micro Frontends",
5
+ "keywords": [
6
+ "micro frontend",
7
+ "microfrontend",
8
+ "micro frontends",
9
+ "micro-frontend",
10
+ "micro-frontends",
11
+ "microservice"
12
+ ],
13
+ "homepage": "https://github.com/kuitos/qiankun#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/kuitos/qiankun/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/kuitos/qiankun.git"
20
+ },
21
+ "license": "MIT",
22
+ "author": "Kuitos",
23
+ "maintainers": [
24
+ "fisecoco",
25
+ "uibot"
26
+ ],
27
+ "sideEffects": false,
28
+ "main": "./lib/index.js",
29
+ "module": "./es/index.js",
30
+ "types": "./es/index.d.ts",
31
+ "files": [
32
+ "dist",
33
+ "es",
34
+ "lib"
35
+ ],
36
+ "scripts": {
37
+ "examples:install": "npm-run-all --serial build install:*",
38
+ "examples:start": "npm-run-all --parallel start:*",
39
+ "examples:start-multiple": "run-p start-main-multiple start:react15 start:vue",
40
+ "install:main": "cd examples/main && yarn",
41
+ "start:main": "cd examples/main && yarn start",
42
+ "start-main-multiple": "cd examples/main && yarn start:multiple",
43
+ "install:react16": "cd examples/react16 && yarn",
44
+ "start:react16": "cd examples/react16 && yarn start",
45
+ "install:react15": "cd examples/react15 && yarn",
46
+ "start:react15": "cd examples/react15 && yarn start",
47
+ "install:vue": "cd examples/vue && yarn",
48
+ "start:vue": "cd examples/vue && yarn start",
49
+ "install:angular9": "cd examples/angular9 && yarn",
50
+ "start:angular9": "cd examples/angular9 && yarn serve:qiankun",
51
+ "install:purehtml": "cd examples/purehtml && yarn",
52
+ "start:purehtml": "cd examples/purehtml && yarn start",
53
+ "install:vue3": "cd examples/vue3 && yarn",
54
+ "start:vue3": "cd examples/vue3 && yarn start",
55
+ "build": "father-build",
56
+ "release": "np --no-cleanup --yolo --no-publish",
57
+ "prepublishOnly": "yarn ci",
58
+ "lint": "yarn lint:js && yarn lint:prettier",
59
+ "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
60
+ "lint:fix": "yarn lint:js -- --fix",
61
+ "lint:prettier": "prettier -c ./src/**/*",
62
+ "prettier": "prettier --write ./src/**/*",
63
+ "docs:dev": "dumi dev",
64
+ "docs:build": "dumi build",
65
+ "ci": "yarn lint && yarn build && yarn test",
66
+ "test": "cross-env NODE_ENV=test jest"
67
+ },
68
+ "husky": {
69
+ "hooks": {
70
+ "pre-commit": "lint-staged",
71
+ "pre-push": "yarn test"
72
+ }
73
+ },
74
+ "lint-staged": {
75
+ "**/*.{js,ts,json,css,md}": [
76
+ "prettier -w"
77
+ ],
78
+ "**/*.{js,ts}": [
79
+ "yarn lint:fix"
80
+ ]
81
+ },
82
+ "jest": {
83
+ "coveragePathIgnorePatterns": [
84
+ "/node_modules/",
85
+ "/__tests__/",
86
+ "/dist/"
87
+ ],
88
+ "moduleFileExtensions": [
89
+ "js",
90
+ "ts"
91
+ ],
92
+ "testMatch": [
93
+ "<rootDir>/src/**/__tests__/**/*.test.ts"
94
+ ],
95
+ "testPathIgnorePatterns": [
96
+ "/node_modules/",
97
+ "/fixtures/"
98
+ ],
99
+ "transform": {
100
+ "^.+\\.ts$": "<rootDir>/node_modules/ts-jest"
101
+ }
102
+ },
103
+ "resolutions": {
104
+ "@types/react": "^16.x"
105
+ },
106
+ "dependencies": {
107
+ "@babel/runtime": "^7.10.5",
108
+ "import-html-entry": "^1.9.0",
109
+ "lodash": "^4.17.11",
110
+ "single-spa": "^5.9.2",
111
+ "tslib": "^1.10.0"
112
+ },
113
+ "devDependencies": {
114
+ "@types/history": "4.7.11",
115
+ "@types/jest": "^25.1.4",
116
+ "@types/lodash": "^4.14.129",
117
+ "@types/minimatch": "3.0.5",
118
+ "@types/node": "14.18.33",
119
+ "@types/vfile-message": "1.x",
120
+ "@umijs/fabric": "^2.0.7",
121
+ "babel-plugin-import": "^1.12.1",
122
+ "cross-env": "^7.0.2",
123
+ "dumi": "1.1.38",
124
+ "father-build": "^1.7.0",
125
+ "husky": "^2.3.0",
126
+ "jest": "^25.2.2",
127
+ "levenary": "^1.1.1",
128
+ "lint-staged": "^10.5.4",
129
+ "np": "^5.0.3",
130
+ "npm-run-all": "^4.1.5",
131
+ "prettier": "^2.1.2",
132
+ "rimraf": "^3.0.0",
133
+ "ts-jest": "^25.2.1",
134
+ "typescript": "^4.1.2",
135
+ "umi-plugin-hire": "^1.0.3"
136
+ }
137
+ }