@modern-js/plugin 1.3.0 → 1.3.3
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/.eslintrc.js +8 -0
- package/CHANGELOG.md +16 -0
- package/dist/js/modern/manager/async.js +9 -5
- package/dist/js/modern/manager/sync.js +10 -7
- package/dist/js/modern/waterfall/async.js +3 -5
- package/dist/js/modern/waterfall/sync.js +3 -5
- package/dist/js/modern/workflow/async.js +0 -3
- package/dist/js/modern/workflow/parallel.js +1 -2
- package/dist/js/node/manager/async.js +9 -5
- package/dist/js/node/manager/sync.js +10 -7
- package/dist/js/node/waterfall/async.js +3 -5
- package/dist/js/node/waterfall/sync.js +3 -5
- package/dist/js/node/workflow/async.js +0 -3
- package/dist/js/node/workflow/parallel.js +1 -2
- package/dist/js/treeshaking/manager/async.js +9 -5
- package/dist/js/treeshaking/manager/sync.js +10 -7
- package/dist/js/treeshaking/waterfall/async.js +7 -10
- package/dist/js/treeshaking/waterfall/sync.js +7 -10
- package/dist/js/treeshaking/workflow/async.js +0 -2
- package/dist/js/treeshaking/workflow/parallel.js +1 -2
- package/dist/types/manager/async.d.ts +1 -1
- package/dist/types/manager/sync.d.ts +1 -1
- package/jest.config.js +0 -1
- package/package.json +1 -1
- package/tests/.eslintrc.js +0 -6
- package/tests/async.test.ts +0 -712
- package/tests/fixtures/async/base/bar.ts +0 -22
- package/tests/fixtures/async/base/foo.ts +0 -20
- package/tests/fixtures/async/base/fooManager.ts +0 -47
- package/tests/fixtures/async/core/index.ts +0 -174
- package/tests/fixtures/async/dynamic/bar.ts +0 -18
- package/tests/fixtures/async/dynamic/foo.ts +0 -27
- package/tests/fixtures/sync/base/bar.ts +0 -21
- package/tests/fixtures/sync/base/foo.ts +0 -20
- package/tests/fixtures/sync/base/fooManager.ts +0 -47
- package/tests/fixtures/sync/core/index.ts +0 -171
- package/tests/fixtures/sync/dynamic/bar.ts +0 -22
- package/tests/fixtures/sync/dynamic/foo.ts +0 -27
- package/tests/helpers.ts +0 -4
- package/tests/pipeline.test.ts +0 -607
- package/tests/sync.test.ts +0 -677
- package/tests/tsconfig.json +0 -13
- package/tests/waterfall.test.ts +0 -172
- package/tests/workflow.test.ts +0 -111
package/.eslintrc.js
ADDED
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# @modern-js/plugin
|
2
2
|
|
3
|
+
## 1.3.3
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 6cffe99d: chore:
|
8
|
+
remove react eslint rules for `modern-js` rule set.
|
9
|
+
add .eslintrc for each package to speed up linting
|
10
|
+
- 60f7d8bf: feat: add tests dir to npmignore
|
11
|
+
|
12
|
+
## 1.3.2
|
13
|
+
|
14
|
+
### Patch Changes
|
15
|
+
|
16
|
+
- dc88abf9: fix: should allow to use plugin without setup function
|
17
|
+
- 0462ff77: feat: add compatible logic of plugin options with "setup" param
|
18
|
+
|
3
19
|
## 1.3.0
|
4
20
|
|
5
21
|
### Minor Changes
|
@@ -34,15 +34,19 @@ export const createAsyncManager = (hooks, api) => {
|
|
34
34
|
|
35
35
|
const usePlugin = (...input) => {
|
36
36
|
for (const plugin of input) {
|
37
|
+
// already created by createPlugin
|
37
38
|
if (isPlugin(plugin)) {
|
38
39
|
addPlugin(plugin);
|
39
|
-
}
|
40
|
+
} // using function to return plugin options
|
41
|
+
else if (typeof plugin === 'function') {
|
40
42
|
const options = plugin();
|
41
43
|
addPlugin(createPlugin(options.setup, options));
|
42
|
-
}
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
} // plain plugin object
|
45
|
+
else if (isObject(plugin)) {
|
46
|
+
addPlugin(createPlugin(plugin.setup, plugin));
|
47
|
+
} // unknown plugin
|
48
|
+
else {
|
49
|
+
console.warn(`Unknown plugin: ${JSON.stringify(plugin)}`);
|
46
50
|
}
|
47
51
|
}
|
48
52
|
|
@@ -44,15 +44,19 @@ export const createManager = (hooks, api) => {
|
|
44
44
|
|
45
45
|
const usePlugin = (...input) => {
|
46
46
|
for (const plugin of input) {
|
47
|
+
// already created by createPlugin
|
47
48
|
if (isPlugin(plugin)) {
|
48
49
|
addPlugin(plugin);
|
49
|
-
}
|
50
|
+
} // using function to return plugin options
|
51
|
+
else if (typeof plugin === 'function') {
|
50
52
|
const options = plugin();
|
51
53
|
addPlugin(createPlugin(options.setup, options));
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
} // plain plugin object
|
55
|
+
else if (isObject(plugin)) {
|
56
|
+
addPlugin(createPlugin(plugin.setup, plugin));
|
57
|
+
} // unknown plugin
|
58
|
+
else {
|
59
|
+
console.warn(`Unknown plugin: ${JSON.stringify(plugin)}`);
|
56
60
|
}
|
57
61
|
}
|
58
62
|
|
@@ -169,8 +173,7 @@ export const cloneHook = hook => {
|
|
169
173
|
|
170
174
|
if (isPipeline(hook)) {
|
171
175
|
return createPipeline();
|
172
|
-
}
|
173
|
-
|
176
|
+
}
|
174
177
|
|
175
178
|
throw new Error(`Unknown hook: ${hook}`);
|
176
179
|
};
|
@@ -11,7 +11,7 @@ export const getAsyncBrook = input => {
|
|
11
11
|
return input;
|
12
12
|
} else if (input && typeof input.middleware === 'function') {
|
13
13
|
return input.middleware;
|
14
|
-
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
14
|
+
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
15
15
|
|
16
16
|
|
17
17
|
throw new Error(`${input} is not a AsyncBrook or { brook: AsyncBrook }`);
|
@@ -24,15 +24,13 @@ export const createAsyncWaterfall = () => {
|
|
24
24
|
return waterfall;
|
25
25
|
};
|
26
26
|
|
27
|
-
const run = (input, options) =>
|
28
|
-
pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
27
|
+
const run = (input, options) => pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
29
28
|
onLast: input => input
|
30
29
|
}));
|
31
30
|
|
32
31
|
const middleware = input => {
|
33
32
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
34
|
-
const container = useContainer();
|
35
|
-
|
33
|
+
const container = useContainer();
|
36
34
|
return pipeline.run(input, {
|
37
35
|
container,
|
38
36
|
onLast: input => input
|
@@ -11,7 +11,7 @@ export const getBrook = input => {
|
|
11
11
|
return input;
|
12
12
|
} else if (input && typeof input.middleware === 'function') {
|
13
13
|
return input.middleware;
|
14
|
-
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
14
|
+
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
15
15
|
|
16
16
|
|
17
17
|
throw new Error(`${input} is not a Brook or { brook: Brook }`);
|
@@ -24,15 +24,13 @@ export const createWaterfall = () => {
|
|
24
24
|
return waterfall;
|
25
25
|
};
|
26
26
|
|
27
|
-
const run = (input, options) =>
|
28
|
-
pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
27
|
+
const run = (input, options) => pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
29
28
|
onLast: input => input
|
30
29
|
}));
|
31
30
|
|
32
31
|
const middleware = input => {
|
33
32
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
34
|
-
const container = useContainer();
|
35
|
-
|
33
|
+
const container = useContainer();
|
36
34
|
return pipeline.run(input, {
|
37
35
|
container,
|
38
36
|
onLast: input => input
|
@@ -21,7 +21,6 @@ export const createAsyncWorkflow = () => {
|
|
21
21
|
}));
|
22
22
|
|
23
23
|
if (isPromise(result)) {
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow,promise/prefer-await-to-then
|
25
24
|
return result.then(result => result.filter(Boolean));
|
26
25
|
} else {
|
27
26
|
return result.filter(Boolean);
|
@@ -40,7 +39,5 @@ export const createAsyncWorkflow = () => {
|
|
40
39
|
const mapAsyncWorkerToAsyncMiddleware = worker => async (input, next) => [await worker(input), ...(await next(input))];
|
41
40
|
|
42
41
|
function isPromise(obj) {
|
43
|
-
/* eslint-disable promise/prefer-await-to-then */
|
44
42
|
return Boolean(obj) && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
45
|
-
/* eslint-enable promise/prefer-await-to-then */
|
46
43
|
}
|
@@ -15,8 +15,7 @@ export const createParallelWorkflow = () => {
|
|
15
15
|
return workflow;
|
16
16
|
};
|
17
17
|
|
18
|
-
const run = async (input, options) =>
|
19
|
-
Promise.all(pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
18
|
+
const run = async (input, options) => Promise.all(pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
20
19
|
onLast: () => []
|
21
20
|
}))).then(result => result.filter(Boolean));
|
22
21
|
|
@@ -45,15 +45,19 @@ const createAsyncManager = (hooks, api) => {
|
|
45
45
|
|
46
46
|
const usePlugin = (...input) => {
|
47
47
|
for (const plugin of input) {
|
48
|
+
// already created by createPlugin
|
48
49
|
if (isPlugin(plugin)) {
|
49
50
|
addPlugin(plugin);
|
50
|
-
}
|
51
|
+
} // using function to return plugin options
|
52
|
+
else if (typeof plugin === 'function') {
|
51
53
|
const options = plugin();
|
52
54
|
addPlugin(createPlugin(options.setup, options));
|
53
|
-
}
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
} // plain plugin object
|
56
|
+
else if ((0, _sync.isObject)(plugin)) {
|
57
|
+
addPlugin(createPlugin(plugin.setup, plugin));
|
58
|
+
} // unknown plugin
|
59
|
+
else {
|
60
|
+
console.warn(`Unknown plugin: ${JSON.stringify(plugin)}`);
|
57
61
|
}
|
58
62
|
}
|
59
63
|
|
@@ -57,15 +57,19 @@ const createManager = (hooks, api) => {
|
|
57
57
|
|
58
58
|
const usePlugin = (...input) => {
|
59
59
|
for (const plugin of input) {
|
60
|
+
// already created by createPlugin
|
60
61
|
if (isPlugin(plugin)) {
|
61
62
|
addPlugin(plugin);
|
62
|
-
}
|
63
|
+
} // using function to return plugin options
|
64
|
+
else if (typeof plugin === 'function') {
|
63
65
|
const options = plugin();
|
64
66
|
addPlugin(createPlugin(options.setup, options));
|
65
|
-
}
|
66
|
-
|
67
|
-
|
68
|
-
|
67
|
+
} // plain plugin object
|
68
|
+
else if (isObject(plugin)) {
|
69
|
+
addPlugin(createPlugin(plugin.setup, plugin));
|
70
|
+
} // unknown plugin
|
71
|
+
else {
|
72
|
+
console.warn(`Unknown plugin: ${JSON.stringify(plugin)}`);
|
69
73
|
}
|
70
74
|
}
|
71
75
|
|
@@ -188,8 +192,7 @@ const cloneHook = hook => {
|
|
188
192
|
|
189
193
|
if ((0, _farrowPipeline.isPipeline)(hook)) {
|
190
194
|
return (0, _farrowPipeline.createPipeline)();
|
191
|
-
}
|
192
|
-
|
195
|
+
}
|
193
196
|
|
194
197
|
throw new Error(`Unknown hook: ${hook}`);
|
195
198
|
};
|
@@ -20,7 +20,7 @@ const getAsyncBrook = input => {
|
|
20
20
|
return input;
|
21
21
|
} else if (input && typeof input.middleware === 'function') {
|
22
22
|
return input.middleware;
|
23
|
-
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
23
|
+
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
24
24
|
|
25
25
|
|
26
26
|
throw new Error(`${input} is not a AsyncBrook or { brook: AsyncBrook }`);
|
@@ -36,15 +36,13 @@ const createAsyncWaterfall = () => {
|
|
36
36
|
return waterfall;
|
37
37
|
};
|
38
38
|
|
39
|
-
const run = (input, options) =>
|
40
|
-
pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
39
|
+
const run = (input, options) => pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
41
40
|
onLast: input => input
|
42
41
|
}));
|
43
42
|
|
44
43
|
const middleware = input => {
|
45
44
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
46
|
-
const container = (0, _farrowPipeline.useContainer)();
|
47
|
-
|
45
|
+
const container = (0, _farrowPipeline.useContainer)();
|
48
46
|
return pipeline.run(input, {
|
49
47
|
container,
|
50
48
|
onLast: input => input
|
@@ -20,7 +20,7 @@ const getBrook = input => {
|
|
20
20
|
return input;
|
21
21
|
} else if (input && typeof input.middleware === 'function') {
|
22
22
|
return input.middleware;
|
23
|
-
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
23
|
+
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
24
24
|
|
25
25
|
|
26
26
|
throw new Error(`${input} is not a Brook or { brook: Brook }`);
|
@@ -36,15 +36,13 @@ const createWaterfall = () => {
|
|
36
36
|
return waterfall;
|
37
37
|
};
|
38
38
|
|
39
|
-
const run = (input, options) =>
|
40
|
-
pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
39
|
+
const run = (input, options) => pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
41
40
|
onLast: input => input
|
42
41
|
}));
|
43
42
|
|
44
43
|
const middleware = input => {
|
45
44
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
46
|
-
const container = (0, _farrowPipeline.useContainer)();
|
47
|
-
|
45
|
+
const container = (0, _farrowPipeline.useContainer)();
|
48
46
|
return pipeline.run(input, {
|
49
47
|
container,
|
50
48
|
onLast: input => input
|
@@ -33,7 +33,6 @@ const createAsyncWorkflow = () => {
|
|
33
33
|
}));
|
34
34
|
|
35
35
|
if (isPromise(result)) {
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow,promise/prefer-await-to-then
|
37
36
|
return result.then(result => result.filter(Boolean));
|
38
37
|
} else {
|
39
38
|
return result.filter(Boolean);
|
@@ -54,7 +53,5 @@ exports.createAsyncWorkflow = createAsyncWorkflow;
|
|
54
53
|
const mapAsyncWorkerToAsyncMiddleware = worker => async (input, next) => [await worker(input), ...(await next(input))];
|
55
54
|
|
56
55
|
function isPromise(obj) {
|
57
|
-
/* eslint-disable promise/prefer-await-to-then */
|
58
56
|
return Boolean(obj) && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
59
|
-
/* eslint-enable promise/prefer-await-to-then */
|
60
57
|
}
|
@@ -27,8 +27,7 @@ const createParallelWorkflow = () => {
|
|
27
27
|
return workflow;
|
28
28
|
};
|
29
29
|
|
30
|
-
const run = async (input, options) =>
|
31
|
-
Promise.all(pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
30
|
+
const run = async (input, options) => Promise.all(pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
32
31
|
onLast: () => []
|
33
32
|
}))).then(result => result.filter(Boolean));
|
34
33
|
|
@@ -62,16 +62,20 @@ export var createAsyncManager = function createAsyncManager(hooks, api) {
|
|
62
62
|
for (var _i = 0, _input = input; _i < _input.length; _i++) {
|
63
63
|
var plugin = _input[_i];
|
64
64
|
|
65
|
+
// already created by createPlugin
|
65
66
|
if (isPlugin(plugin)) {
|
66
67
|
addPlugin(plugin);
|
67
|
-
}
|
68
|
+
} // using function to return plugin options
|
69
|
+
else if (typeof plugin === 'function') {
|
68
70
|
var _options = plugin();
|
69
71
|
|
70
72
|
addPlugin(createPlugin(_options.setup, _options));
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
} // plain plugin object
|
74
|
+
else if (isObject(plugin)) {
|
75
|
+
addPlugin(createPlugin(plugin.setup, plugin));
|
76
|
+
} // unknown plugin
|
77
|
+
else {
|
78
|
+
console.warn("Unknown plugin: ".concat(JSON.stringify(plugin)));
|
75
79
|
}
|
76
80
|
}
|
77
81
|
|
@@ -68,16 +68,20 @@ export var createManager = function createManager(hooks, api) {
|
|
68
68
|
for (var _i = 0, _input = input; _i < _input.length; _i++) {
|
69
69
|
var plugin = _input[_i];
|
70
70
|
|
71
|
+
// already created by createPlugin
|
71
72
|
if (isPlugin(plugin)) {
|
72
73
|
addPlugin(plugin);
|
73
|
-
}
|
74
|
+
} // using function to return plugin options
|
75
|
+
else if (typeof plugin === 'function') {
|
74
76
|
var _options = plugin();
|
75
77
|
|
76
78
|
addPlugin(createPlugin(_options.setup, _options));
|
77
|
-
}
|
78
|
-
|
79
|
-
|
80
|
-
|
79
|
+
} // plain plugin object
|
80
|
+
else if (isObject(plugin)) {
|
81
|
+
addPlugin(createPlugin(plugin.setup, plugin));
|
82
|
+
} // unknown plugin
|
83
|
+
else {
|
84
|
+
console.warn("Unknown plugin: ".concat(JSON.stringify(plugin)));
|
81
85
|
}
|
82
86
|
}
|
83
87
|
|
@@ -217,8 +221,7 @@ export var cloneHook = function cloneHook(hook) {
|
|
217
221
|
|
218
222
|
if (isPipeline(hook)) {
|
219
223
|
return createPipeline();
|
220
|
-
}
|
221
|
-
|
224
|
+
}
|
222
225
|
|
223
226
|
throw new Error("Unknown hook: ".concat(hook));
|
224
227
|
};
|
@@ -29,7 +29,7 @@ export var getAsyncBrook = function getAsyncBrook(input) {
|
|
29
29
|
return input;
|
30
30
|
} else if (input && typeof input.middleware === 'function') {
|
31
31
|
return input.middleware;
|
32
|
-
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
32
|
+
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
33
33
|
|
34
34
|
|
35
35
|
throw new Error("".concat(input, " is not a AsyncBrook or { brook: AsyncBrook }"));
|
@@ -47,19 +47,16 @@ export var createAsyncWaterfall = function createAsyncWaterfall() {
|
|
47
47
|
};
|
48
48
|
|
49
49
|
var run = function run(input, options) {
|
50
|
-
return (
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}))
|
56
|
-
);
|
50
|
+
return pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
51
|
+
onLast: function onLast(input) {
|
52
|
+
return input;
|
53
|
+
}
|
54
|
+
}));
|
57
55
|
};
|
58
56
|
|
59
57
|
var middleware = function middleware(input) {
|
60
58
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
61
|
-
var container = useContainer();
|
62
|
-
|
59
|
+
var container = useContainer();
|
63
60
|
return pipeline.run(input, {
|
64
61
|
container: container,
|
65
62
|
onLast: function onLast(input) {
|
@@ -23,7 +23,7 @@ export var getBrook = function getBrook(input) {
|
|
23
23
|
return input;
|
24
24
|
} else if (input && typeof input.middleware === 'function') {
|
25
25
|
return input.middleware;
|
26
|
-
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
26
|
+
} // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
27
27
|
|
28
28
|
|
29
29
|
throw new Error("".concat(input, " is not a Brook or { brook: Brook }"));
|
@@ -41,19 +41,16 @@ export var createWaterfall = function createWaterfall() {
|
|
41
41
|
};
|
42
42
|
|
43
43
|
var run = function run(input, options) {
|
44
|
-
return (
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}))
|
50
|
-
);
|
44
|
+
return pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
45
|
+
onLast: function onLast(input) {
|
46
|
+
return input;
|
47
|
+
}
|
48
|
+
}));
|
51
49
|
};
|
52
50
|
|
53
51
|
var middleware = function middleware(input) {
|
54
52
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
55
|
-
var container = useContainer();
|
56
|
-
|
53
|
+
var container = useContainer();
|
57
54
|
return pipeline.run(input, {
|
58
55
|
container: container,
|
59
56
|
onLast: function onLast(input) {
|
@@ -124,7 +124,5 @@ var mapAsyncWorkerToAsyncMiddleware = function mapAsyncWorkerToAsyncMiddleware(w
|
|
124
124
|
};
|
125
125
|
|
126
126
|
function isPromise(obj) {
|
127
|
-
/* eslint-disable promise/prefer-await-to-then */
|
128
127
|
return Boolean(obj) && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
129
|
-
/* eslint-enable promise/prefer-await-to-then */
|
130
128
|
}
|
@@ -45,8 +45,7 @@ export var createParallelWorkflow = function createParallelWorkflow() {
|
|
45
45
|
while (1) {
|
46
46
|
switch (_context.prev = _context.next) {
|
47
47
|
case 0:
|
48
|
-
return _context.abrupt("return",
|
49
|
-
Promise.all(pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
48
|
+
return _context.abrupt("return", Promise.all(pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
|
50
49
|
onLast: function onLast() {
|
51
50
|
return [];
|
52
51
|
}
|
@@ -25,7 +25,7 @@ export declare type AsyncManager<Hooks, API> = {
|
|
25
25
|
* @param plugins one or more plugin.
|
26
26
|
*/
|
27
27
|
|
28
|
-
usePlugin: (...plugins: AsyncPlugin<Hooks, API>
|
28
|
+
usePlugin: (...plugins: Array<AsyncPlugin<Hooks, API> | PluginOptions<Hooks, AsyncSetup<Hooks, API>> | (() => PluginOptions<Hooks, AsyncSetup<Hooks, API>>)>) => AsyncManager<Hooks, API>;
|
29
29
|
/**
|
30
30
|
* Init manager, it will call the setup function of all registered plugins.
|
31
31
|
* @param options passing a custom container.
|
@@ -26,7 +26,7 @@ export declare type Manager<Hooks, API> = {
|
|
26
26
|
* @param plugins one or more plugin.
|
27
27
|
*/
|
28
28
|
|
29
|
-
usePlugin: (...plugins: Plugin<Hooks, API>
|
29
|
+
usePlugin: (...plugins: Array<Plugin<Hooks, API> | PluginOptions<Hooks, Setup<Hooks, API>> | (() => PluginOptions<Hooks, Setup<Hooks, API>>)>) => Manager<Hooks, API>;
|
30
30
|
/**
|
31
31
|
* Init manager, it will call the setup function of all registered plugins.
|
32
32
|
* @param options passing a custom container.
|
package/jest.config.js
CHANGED
package/package.json
CHANGED