@modern-js/plugin 1.2.0 → 1.3.1

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 (49) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/js/modern/manager/async.js +59 -28
  3. package/dist/js/modern/manager/index.js +2 -1
  4. package/dist/js/modern/manager/sync.js +79 -60
  5. package/dist/js/modern/manager/types.js +0 -0
  6. package/dist/js/modern/waterfall/async.js +4 -5
  7. package/dist/js/modern/waterfall/sync.js +0 -1
  8. package/dist/js/modern/workflow/async.js +1 -2
  9. package/dist/js/modern/workflow/sync.js +0 -1
  10. package/dist/js/node/manager/async.js +57 -25
  11. package/dist/js/node/manager/index.js +13 -0
  12. package/dist/js/node/manager/sync.js +84 -58
  13. package/dist/js/node/manager/types.js +0 -0
  14. package/dist/js/node/waterfall/async.js +4 -5
  15. package/dist/js/node/waterfall/sync.js +0 -1
  16. package/dist/js/node/workflow/async.js +1 -2
  17. package/dist/js/node/workflow/sync.js +0 -1
  18. package/dist/js/treeshaking/manager/async.js +63 -34
  19. package/dist/js/treeshaking/manager/index.js +2 -1
  20. package/dist/js/treeshaking/manager/sync.js +85 -62
  21. package/dist/js/treeshaking/manager/types.js +0 -0
  22. package/dist/js/treeshaking/waterfall/async.js +4 -5
  23. package/dist/js/treeshaking/waterfall/sync.js +0 -1
  24. package/dist/js/treeshaking/workflow/async.js +1 -2
  25. package/dist/js/treeshaking/workflow/sync.js +0 -1
  26. package/dist/types/manager/async.d.ts +60 -21
  27. package/dist/types/manager/index.d.ts +2 -1
  28. package/dist/types/manager/sync.d.ts +74 -43
  29. package/dist/types/manager/types.d.ts +41 -0
  30. package/dist/types/waterfall/async.d.ts +2 -2
  31. package/package.json +2 -1
  32. package/tests/async.test.ts +143 -22
  33. package/tests/fixtures/async/core/index.ts +12 -4
  34. package/tests/fixtures/async/dynamic/foo.ts +2 -2
  35. package/tests/fixtures/sync/core/index.ts +9 -4
  36. package/tests/fixtures/sync/dynamic/foo.ts +2 -2
  37. package/tests/sync.test.ts +136 -21
  38. package/src/index.ts +0 -5
  39. package/src/manager/async.ts +0 -248
  40. package/src/manager/index.ts +0 -3
  41. package/src/manager/runner.ts +0 -15
  42. package/src/manager/sync.ts +0 -458
  43. package/src/waterfall/async.ts +0 -109
  44. package/src/waterfall/index.ts +0 -2
  45. package/src/waterfall/sync.ts +0 -110
  46. package/src/workflow/async.ts +0 -96
  47. package/src/workflow/index.ts +0 -3
  48. package/src/workflow/parallel.ts +0 -97
  49. package/src/workflow/sync.ts +0 -82
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.hasOwnProperty = exports.generateRunner = exports.createManager = exports.cloneProgressRecord = exports.cloneProgress = exports.DEFAULT_OPTIONS = void 0;
6
+ exports.isObject = exports.hasOwnProperty = exports.generateRunner = exports.createManager = exports.closeHooksMap = exports.cloneHook = exports.DEFAULT_OPTIONS = void 0;
7
7
 
8
8
  var _farrowPipeline = require("farrow-pipeline");
9
9
 
@@ -25,56 +25,77 @@ const DEFAULT_OPTIONS = {
25
25
  pre: [],
26
26
  post: [],
27
27
  rivals: [],
28
- required: []
28
+ required: [],
29
+ usePlugins: [],
30
+ registerHook: {}
29
31
  };
30
32
  exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
31
33
 
32
- const createManager = processes => {
34
+ const createManager = (hooks, api) => {
33
35
  let index = 0;
34
36
 
35
- const createPlugin = (initializer, options = {}) => _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_OPTIONS), {}, {
36
- name: `No.${index++} plugin`
37
- }, options), {}, {
38
- SYNC_PLUGIN_SYMBOL,
39
- initializer
40
- });
41
-
42
- const isPlugin = input => hasOwnProperty(input, SYNC_PLUGIN_SYMBOL) && input[SYNC_PLUGIN_SYMBOL] === SYNC_PLUGIN_SYMBOL;
37
+ let currentHooks = _objectSpread({}, hooks);
43
38
 
44
- const registe = extraProcesses => {
45
- // eslint-disable-next-line no-param-reassign
46
- processes = _objectSpread(_objectSpread({}, extraProcesses), processes);
39
+ const registerHook = extraHooks => {
40
+ currentHooks = _objectSpread(_objectSpread({}, extraHooks), currentHooks);
47
41
  };
48
42
 
49
- const clone = () => {
43
+ const isPlugin = input => isObject(input) && hasOwnProperty(input, SYNC_PLUGIN_SYMBOL) && input[SYNC_PLUGIN_SYMBOL] === SYNC_PLUGIN_SYMBOL;
44
+
45
+ const pluginAPI = _objectSpread(_objectSpread({}, api), {}, {
46
+ useHookRunners: _runner.useRunner
47
+ });
48
+
49
+ const clone = overrideAPI => {
50
50
  let plugins = [];
51
51
 
52
+ const addPlugin = plugin => {
53
+ if (!includePlugin(plugins, plugin)) {
54
+ plugins.push(_objectSpread({}, plugin));
55
+ }
56
+ };
57
+
52
58
  const usePlugin = (...input) => {
53
59
  for (const plugin of input) {
60
+ // already created by createPlugin
54
61
  if (isPlugin(plugin)) {
55
- if (!includePlugin(plugins, plugin)) {
56
- plugins.push(_objectSpread(_objectSpread({}, plugin), {}, {
57
- index: plugins.length
58
- }));
59
- }
60
- } else {
61
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62
- // @ts-expect-error
63
- console.warn(`Unknown plugin: ${plugin.name}`);
62
+ addPlugin(plugin);
63
+ } // using function to return plugin options
64
+ else if (typeof plugin === 'function') {
65
+ const options = plugin();
66
+ addPlugin(createPlugin(options.setup, options));
67
+ } // plain plugin options with `setup` param
68
+ else if (plugin.setup) {
69
+ addPlugin(createPlugin(plugin.setup, plugin));
70
+ } // unknown plugin
71
+ else {
72
+ console.warn(`Unknown plugin: ${plugin.name || ''}`);
64
73
  }
65
74
  }
66
75
 
67
- return {
68
- createPlugin,
69
- isPlugin,
70
- usePlugin,
71
- init,
72
- run,
73
- clear,
74
- registe,
75
- useRunner: _runner.useRunner,
76
- clone
77
- };
76
+ return manager;
77
+ };
78
+
79
+ const createPlugin = ( // eslint-disable-next-line @typescript-eslint/no-empty-function
80
+ setup = () => {}, options = {}) => {
81
+ var _options$usePlugins;
82
+
83
+ if ((_options$usePlugins = options.usePlugins) !== null && _options$usePlugins !== void 0 && _options$usePlugins.length) {
84
+ options.usePlugins.forEach(plugin => {
85
+ usePlugin(createPlugin(plugin.setup, plugin));
86
+ });
87
+ }
88
+
89
+ if (options.registerHook) {
90
+ registerHook(options.registerHook);
91
+ }
92
+
93
+ return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_OPTIONS), {}, {
94
+ name: `No.${index++} plugin`
95
+ }, options), {}, {
96
+ SYNC_PLUGIN_SYMBOL,
97
+ setup
98
+ });
78
99
  };
79
100
 
80
101
  const clear = () => {
@@ -86,9 +107,12 @@ const createManager = processes => {
86
107
  const init = options => {
87
108
  const container = (options === null || options === void 0 ? void 0 : options.container) || currentContainer;
88
109
  const sortedPlugins = sortPlugins(plugins);
110
+
111
+ const mergedPluginAPI = _objectSpread(_objectSpread({}, pluginAPI), overrideAPI);
112
+
89
113
  checkPlugins(sortedPlugins);
90
- const hooksList = sortedPlugins.map(plugin => (0, _farrowPipeline.runWithContainer)(() => plugin.initializer(), container));
91
- return generateRunner(hooksList, container, processes);
114
+ const hooksList = sortedPlugins.map(plugin => (0, _farrowPipeline.runWithContainer)(() => plugin.setup(mergedPluginAPI), container));
115
+ return generateRunner(hooksList, container, currentHooks);
92
116
  };
93
117
 
94
118
  const run = (cb, options) => {
@@ -96,17 +120,18 @@ const createManager = processes => {
96
120
  return (0, _farrowPipeline.runWithContainer)(cb, container);
97
121
  };
98
122
 
99
- return {
123
+ const manager = {
100
124
  createPlugin,
101
125
  isPlugin,
102
126
  usePlugin,
103
127
  init,
104
128
  clear,
105
129
  run,
106
- registe,
130
+ registerHook,
107
131
  useRunner: _runner.useRunner,
108
132
  clone
109
133
  };
134
+ return manager;
110
135
  };
111
136
 
112
137
  return clone();
@@ -114,11 +139,11 @@ const createManager = processes => {
114
139
 
115
140
  exports.createManager = createManager;
116
141
 
117
- const generateRunner = (hooksList, container, processes) => {
142
+ const generateRunner = (hooksList, container, hooksMap) => {
118
143
  const runner = {};
119
- const cloneShape = cloneProgressRecord(processes);
144
+ const cloneShape = closeHooksMap(hooksMap);
120
145
 
121
- if (processes) {
146
+ if (hooksMap) {
122
147
  for (const key in cloneShape) {
123
148
  for (const hooks of hooksList) {
124
149
  if (!hooks) {
@@ -126,8 +151,6 @@ const generateRunner = (hooksList, container, processes) => {
126
151
  }
127
152
 
128
153
  if (hooks[key]) {
129
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
130
- // @ts-expect-error
131
154
  cloneShape[key].use(hooks[key]);
132
155
  }
133
156
  } // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -146,39 +169,38 @@ const generateRunner = (hooksList, container, processes) => {
146
169
 
147
170
  exports.generateRunner = generateRunner;
148
171
 
149
- const cloneProgress = progress => {
150
- if ((0, _waterfall.isWaterfall)(progress)) {
172
+ const cloneHook = hook => {
173
+ if ((0, _waterfall.isWaterfall)(hook)) {
151
174
  return (0, _waterfall.createWaterfall)();
152
175
  }
153
176
 
154
- if ((0, _waterfall.isAsyncWaterfall)(progress)) {
177
+ if ((0, _waterfall.isAsyncWaterfall)(hook)) {
155
178
  return (0, _waterfall.createAsyncWaterfall)();
156
179
  }
157
180
 
158
- if ((0, _workflow.isWorkflow)(progress)) {
181
+ if ((0, _workflow.isWorkflow)(hook)) {
159
182
  return (0, _workflow.createWorkflow)();
160
183
  }
161
184
 
162
- if ((0, _workflow.isAsyncWorkflow)(progress)) {
185
+ if ((0, _workflow.isAsyncWorkflow)(hook)) {
163
186
  return (0, _workflow.createAsyncWorkflow)();
164
187
  }
165
188
 
166
- if ((0, _workflow.isParallelWorkflow)(progress)) {
189
+ if ((0, _workflow.isParallelWorkflow)(hook)) {
167
190
  return (0, _workflow.createParallelWorkflow)();
168
191
  }
169
192
 
170
- if ((0, _farrowPipeline.isPipeline)(progress)) {
193
+ if ((0, _farrowPipeline.isPipeline)(hook)) {
171
194
  return (0, _farrowPipeline.createPipeline)();
172
195
  } // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
173
196
 
174
197
 
175
- throw new Error(`Unknown progress: ${progress}`);
176
- }; // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
177
-
198
+ throw new Error(`Unknown hook: ${hook}`);
199
+ };
178
200
 
179
- exports.cloneProgress = cloneProgress;
201
+ exports.cloneHook = cloneHook;
180
202
 
181
- const cloneProgressRecord = record => {
203
+ const closeHooksMap = record => {
182
204
  if (!record) {
183
205
  return record;
184
206
  }
@@ -188,13 +210,13 @@ const cloneProgressRecord = record => {
188
210
  for (const key in record) {
189
211
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
190
212
  // @ts-expect-error
191
- result[key] = cloneProgress(record[key]);
213
+ result[key] = cloneHook(record[key]);
192
214
  }
193
215
 
194
216
  return result;
195
217
  };
196
218
 
197
- exports.cloneProgressRecord = cloneProgressRecord;
219
+ exports.closeHooksMap = closeHooksMap;
198
220
 
199
221
  const includePlugin = (plugins, input) => {
200
222
  for (const plugin of plugins) {
@@ -250,6 +272,10 @@ const checkPlugins = plugins => {
250
272
  }
251
273
  };
252
274
 
275
+ const isObject = obj => obj !== null && typeof obj === 'object';
276
+
277
+ exports.isObject = isObject;
278
+
253
279
  const hasOwnProperty = (obj, prop) => obj.hasOwnProperty(prop);
254
280
 
255
281
  exports.hasOwnProperty = hasOwnProperty;
File without changes
@@ -18,8 +18,8 @@ const ASYNC_WATERFALL_SYMBOL = Symbol('ASYNC_WATERFALL_SYMBOL');
18
18
  const getAsyncBrook = input => {
19
19
  if (typeof input === 'function') {
20
20
  return input;
21
- } else if (input && typeof input.middlware === 'function') {
22
- return input.middlware;
21
+ } else if (input && typeof input.middleware === 'function') {
22
+ return input.middleware;
23
23
  } // eslint-disable-next-line @typescript-eslint/no-base-to-string,@typescript-eslint/restrict-template-expressions
24
24
 
25
25
 
@@ -28,7 +28,6 @@ const getAsyncBrook = input => {
28
28
 
29
29
  exports.getAsyncBrook = getAsyncBrook;
30
30
 
31
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
32
31
  const createAsyncWaterfall = () => {
33
32
  const pipeline = (0, _farrowPipeline.createAsyncPipeline)();
34
33
 
@@ -42,7 +41,7 @@ const createAsyncWaterfall = () => {
42
41
  onLast: input => input
43
42
  }));
44
43
 
45
- const middlware = input => {
44
+ const middleware = input => {
46
45
  // eslint-disable-next-line react-hooks/rules-of-hooks
47
46
  const container = (0, _farrowPipeline.useContainer)(); // eslint-disable-next-line @typescript-eslint/no-shadow
48
47
 
@@ -55,7 +54,7 @@ const createAsyncWaterfall = () => {
55
54
  const waterfall = _objectSpread(_objectSpread({}, pipeline), {}, {
56
55
  use,
57
56
  run,
58
- middlware,
57
+ middleware,
59
58
  [ASYNC_WATERFALL_SYMBOL]: true
60
59
  });
61
60
 
@@ -28,7 +28,6 @@ const getBrook = input => {
28
28
 
29
29
  exports.getBrook = getBrook;
30
30
 
31
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
32
31
  const createWaterfall = () => {
33
32
  const pipeline = (0, _farrowPipeline.createPipeline)();
34
33
 
@@ -15,8 +15,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
15
15
 
16
16
  const ASYNC_WORKFLOW_SYMBOL = Symbol('ASYNC_WORKFLOW_SYMBOL');
17
17
 
18
- const isAsyncWorkflow = input => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]); // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
19
-
18
+ const isAsyncWorkflow = input => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
20
19
 
21
20
  exports.isAsyncWorkflow = isAsyncWorkflow;
22
21
 
@@ -15,7 +15,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
15
15
 
16
16
  const WORKFLOW_SYMBOL = Symbol('WORKFLOW_SYMBOL');
17
17
 
18
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
19
18
  const createWorkflow = () => {
20
19
  const pipeline = (0, _farrowPipeline.createPipeline)();
21
20
 
@@ -25,35 +25,35 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
25
25
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
26
 
27
27
  import { runWithContainer, createContainer } from 'farrow-pipeline';
28
- import { generateRunner, hasOwnProperty, DEFAULT_OPTIONS } from "./sync";
29
- import { useRunner } from "./runner"; // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
30
-
28
+ import { isObject, generateRunner, hasOwnProperty, DEFAULT_OPTIONS } from "./sync";
29
+ import { useRunner } from "./runner";
31
30
  var ASYNC_PLUGIN_SYMBOL = 'ASYNC_PLUGIN_SYMBOL';
32
- export var createAsyncManager = function createAsyncManager(processes) {
31
+ export var createAsyncManager = function createAsyncManager(hooks, api) {
33
32
  var index = 0;
34
33
 
35
- var createPlugin = function createPlugin(initializer) {
36
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
37
- return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_OPTIONS), {}, {
38
- name: "No.".concat(index++, " plugin")
39
- }, options), {}, {
40
- ASYNC_PLUGIN_SYMBOL: ASYNC_PLUGIN_SYMBOL,
41
- initializer: initializer
42
- });
34
+ var currentHooks = _objectSpread({}, hooks);
35
+
36
+ var registerHook = function registerHook(extraHooks) {
37
+ currentHooks = _objectSpread(_objectSpread({}, extraHooks), currentHooks);
43
38
  };
44
39
 
45
40
  var isPlugin = function isPlugin(input) {
46
- return hasOwnProperty(input, ASYNC_PLUGIN_SYMBOL) && input[ASYNC_PLUGIN_SYMBOL] === ASYNC_PLUGIN_SYMBOL;
41
+ return isObject(input) && hasOwnProperty(input, ASYNC_PLUGIN_SYMBOL) && input[ASYNC_PLUGIN_SYMBOL] === ASYNC_PLUGIN_SYMBOL;
47
42
  };
48
43
 
49
- var registe = function registe(extraProcesses) {
50
- // eslint-disable-next-line no-param-reassign
51
- processes = _objectSpread(_objectSpread({}, extraProcesses), processes);
52
- };
44
+ var pluginAPI = _objectSpread(_objectSpread({}, api), {}, {
45
+ useHookRunners: useRunner
46
+ });
53
47
 
54
- var clone = function clone() {
48
+ var clone = function clone(overrideAPI) {
55
49
  var plugins = [];
56
50
 
51
+ var addPlugin = function addPlugin(plugin) {
52
+ if (!includeAsyncPlugin(plugins, plugin)) {
53
+ plugins.push(_objectSpread({}, plugin));
54
+ }
55
+ };
56
+
57
57
  var usePlugin = function usePlugin() {
58
58
  for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
59
59
  input[_key] = arguments[_key];
@@ -62,22 +62,50 @@ export var createAsyncManager = function createAsyncManager(processes) {
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
- if (!includeAsyncPlugin(plugins, plugin)) {
67
- plugins.push(_objectSpread(_objectSpread({}, plugin), {}, {
68
- index: plugins.length
69
- }));
70
- }
71
- } else {
72
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
73
- // @ts-expect-error
74
- console.warn("Unknown plugin: ".concat(plugin.name));
67
+ addPlugin(plugin);
68
+ } // using function to return plugin options
69
+ else if (typeof plugin === 'function') {
70
+ var _options = plugin();
71
+
72
+ addPlugin(createPlugin(_options.setup, _options));
73
+ } // plain plugin options with `setup` param
74
+ else if (plugin.setup) {
75
+ addPlugin(createPlugin(plugin.setup, plugin));
76
+ } // unknown plugin
77
+ else {
78
+ console.warn("Unknown plugin: ".concat(plugin.name || ''));
75
79
  }
76
80
  }
77
81
 
78
82
  return manager;
79
83
  };
80
84
 
85
+ var createPlugin = function createPlugin() {
86
+ var _options$usePlugins;
87
+
88
+ var setup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
89
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
90
+
91
+ if ((_options$usePlugins = options.usePlugins) !== null && _options$usePlugins !== void 0 && _options$usePlugins.length) {
92
+ options.usePlugins.forEach(function (plugin) {
93
+ usePlugin(createPlugin(plugin.setup, plugin));
94
+ });
95
+ }
96
+
97
+ if (options.registerHook) {
98
+ registerHook(options.registerHook);
99
+ }
100
+
101
+ return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_OPTIONS), {}, {
102
+ name: "No.".concat(index++, " plugin")
103
+ }, options), {}, {
104
+ ASYNC_PLUGIN_SYMBOL: ASYNC_PLUGIN_SYMBOL,
105
+ setup: setup
106
+ });
107
+ };
108
+
81
109
  var clear = function clear() {
82
110
  plugins = [];
83
111
  };
@@ -86,26 +114,27 @@ export var createAsyncManager = function createAsyncManager(processes) {
86
114
 
87
115
  var init = /*#__PURE__*/function () {
88
116
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
89
- var container, sortedPlugins, hooksList;
117
+ var container, sortedPlugins, mergedPluginAPI, hooksList;
90
118
  return _regeneratorRuntime.wrap(function _callee$(_context) {
91
119
  while (1) {
92
120
  switch (_context.prev = _context.next) {
93
121
  case 0:
94
122
  container = (options === null || options === void 0 ? void 0 : options.container) || currentContainer;
95
123
  sortedPlugins = sortAsyncPlugins(plugins);
124
+ mergedPluginAPI = _objectSpread(_objectSpread({}, pluginAPI), overrideAPI);
96
125
  checkAsyncPlugins(sortedPlugins);
97
- _context.next = 5;
126
+ _context.next = 6;
98
127
  return Promise.all(sortedPlugins.map(function (plugin) {
99
128
  return runWithContainer(function () {
100
- return plugin.initializer();
129
+ return plugin.setup(mergedPluginAPI);
101
130
  }, container);
102
131
  }));
103
132
 
104
- case 5:
133
+ case 6:
105
134
  hooksList = _context.sent;
106
- return _context.abrupt("return", generateRunner(hooksList, container, processes));
135
+ return _context.abrupt("return", generateRunner(hooksList, container, currentHooks));
107
136
 
108
- case 7:
137
+ case 8:
109
138
  case "end":
110
139
  return _context.stop();
111
140
  }
@@ -131,7 +160,7 @@ export var createAsyncManager = function createAsyncManager(processes) {
131
160
  run: run,
132
161
  clear: clear,
133
162
  clone: clone,
134
- registe: registe,
163
+ registerHook: registerHook,
135
164
  useRunner: useRunner
136
165
  };
137
166
  return manager;
@@ -1,3 +1,4 @@
1
1
  export * from "./sync";
2
2
  export * from "./async";
3
- export * from "./runner";
3
+ export * from "./runner";
4
+ export * from "./types";