@modern-js/plugin 2.69.7 → 3.0.0-alpha.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 (267) hide show
  1. package/dist/cjs/cli/api.js +119 -0
  2. package/dist/cjs/cli/context.js +85 -0
  3. package/dist/cjs/cli/hooks.js +65 -0
  4. package/dist/cjs/cli/index.js +68 -0
  5. package/dist/cjs/cli/run/config/createLoadedConfig.js +87 -0
  6. package/dist/cjs/cli/run/config/createResolvedConfig.js +48 -0
  7. package/dist/cjs/cli/run/config/loadConfig.js +113 -0
  8. package/dist/cjs/cli/run/create.js +187 -0
  9. package/dist/cjs/cli/run/index.js +56 -0
  10. package/dist/cjs/cli/run/run.js +57 -0
  11. package/dist/cjs/cli/run/types.js +18 -0
  12. package/dist/cjs/cli/run/utils/checkIsDuplicationPlugin.js +45 -0
  13. package/dist/cjs/cli/run/utils/commander.js +56 -0
  14. package/dist/cjs/cli/run/utils/createFileWatcher.js +112 -0
  15. package/dist/cjs/cli/run/utils/debug.js +37 -0
  16. package/dist/cjs/cli/run/utils/initAppDir.js +55 -0
  17. package/dist/cjs/cli/run/utils/mergeConfig.js +66 -0
  18. package/dist/cjs/hooks.js +169 -0
  19. package/dist/cjs/index.js +53 -26
  20. package/dist/cjs/manager.js +135 -0
  21. package/dist/cjs/runtime/api.js +95 -0
  22. package/dist/cjs/runtime/context.js +60 -0
  23. package/dist/cjs/runtime/hooks.js +46 -0
  24. package/dist/cjs/runtime/index.js +51 -0
  25. package/dist/cjs/runtime/run/create.js +79 -0
  26. package/dist/cjs/runtime/run/index.js +37 -0
  27. package/dist/cjs/runtime/run/types.js +18 -0
  28. package/dist/cjs/server/api.js +96 -0
  29. package/dist/cjs/server/context.js +75 -0
  30. package/dist/cjs/server/hooks.js +43 -0
  31. package/dist/cjs/server/index.js +54 -0
  32. package/dist/cjs/server/run/create.js +79 -0
  33. package/dist/cjs/server/run/index.js +40 -0
  34. package/dist/cjs/server/run/types.js +18 -0
  35. package/dist/cjs/types/cli/api.js +18 -0
  36. package/dist/cjs/types/cli/context.js +18 -0
  37. package/dist/cjs/types/cli/hooks.js +18 -0
  38. package/dist/cjs/types/cli/index.js +18 -0
  39. package/dist/cjs/types/cli/plugin.js +18 -0
  40. package/dist/cjs/types/hooks.js +18 -0
  41. package/dist/cjs/types/index.js +18 -0
  42. package/dist/cjs/types/plugin.js +18 -0
  43. package/dist/cjs/types/runtime/api.js +18 -0
  44. package/dist/cjs/types/runtime/context.js +18 -0
  45. package/dist/cjs/types/runtime/hooks.js +18 -0
  46. package/dist/cjs/types/runtime/index.js +18 -0
  47. package/dist/cjs/types/runtime/plugin.js +18 -0
  48. package/dist/cjs/types/server/api.js +18 -0
  49. package/dist/cjs/types/server/context.js +18 -0
  50. package/dist/cjs/types/server/hooks.js +18 -0
  51. package/dist/cjs/types/server/index.js +18 -0
  52. package/dist/cjs/types/server/plugin.js +18 -0
  53. package/dist/cjs/types/utils.js +18 -0
  54. package/dist/esm/cli/api.mjs +85 -0
  55. package/dist/esm/cli/context.mjs +38 -0
  56. package/dist/esm/cli/hooks.mjs +31 -0
  57. package/dist/esm/cli/index.mjs +7 -0
  58. package/dist/esm/cli/run/config/createLoadedConfig.mjs +53 -0
  59. package/dist/esm/cli/run/config/createResolvedConfig.mjs +14 -0
  60. package/dist/esm/cli/run/config/loadConfig.mjs +59 -0
  61. package/dist/esm/cli/run/create.mjs +150 -0
  62. package/dist/esm/cli/run/index.mjs +7 -0
  63. package/dist/esm/cli/run/run.mjs +23 -0
  64. package/dist/esm/cli/run/types.mjs +0 -0
  65. package/dist/esm/cli/run/utils/checkIsDuplicationPlugin.mjs +11 -0
  66. package/dist/esm/cli/run/utils/commander.mjs +16 -0
  67. package/dist/esm/cli/run/utils/createFileWatcher.mjs +68 -0
  68. package/dist/esm/cli/run/utils/debug.mjs +3 -0
  69. package/dist/esm/cli/run/utils/initAppDir.mjs +11 -0
  70. package/dist/esm/cli/run/utils/mergeConfig.mjs +32 -0
  71. package/dist/esm/hooks.mjs +120 -0
  72. package/dist/esm/index.mjs +3 -0
  73. package/dist/esm/manager.mjs +101 -0
  74. package/dist/esm/runtime/api.mjs +61 -0
  75. package/dist/esm/runtime/context.mjs +23 -0
  76. package/dist/esm/runtime/hooks.mjs +12 -0
  77. package/dist/esm/runtime/index.mjs +5 -0
  78. package/dist/esm/runtime/run/create.mjs +45 -0
  79. package/dist/esm/runtime/run/index.mjs +3 -0
  80. package/dist/esm/runtime/run/types.mjs +0 -0
  81. package/dist/esm/server/api.mjs +59 -0
  82. package/dist/esm/server/context.mjs +38 -0
  83. package/dist/esm/server/hooks.mjs +9 -0
  84. package/dist/esm/server/index.mjs +5 -0
  85. package/dist/esm/server/run/create.mjs +45 -0
  86. package/dist/esm/server/run/index.mjs +3 -0
  87. package/dist/esm/server/run/types.mjs +0 -0
  88. package/dist/esm/types/cli/api.mjs +0 -0
  89. package/dist/esm/types/cli/context.mjs +0 -0
  90. package/dist/esm/types/cli/hooks.mjs +0 -0
  91. package/dist/esm/types/cli/index.mjs +0 -0
  92. package/dist/esm/types/cli/plugin.mjs +0 -0
  93. package/dist/esm/types/hooks.mjs +0 -0
  94. package/dist/esm/types/index.mjs +0 -0
  95. package/dist/esm/types/plugin.mjs +0 -0
  96. package/dist/esm/types/runtime/api.mjs +0 -0
  97. package/dist/esm/types/runtime/context.mjs +0 -0
  98. package/dist/esm/types/runtime/hooks.mjs +0 -0
  99. package/dist/esm/types/runtime/index.mjs +0 -0
  100. package/dist/esm/types/runtime/plugin.mjs +0 -0
  101. package/dist/esm/types/server/api.mjs +0 -0
  102. package/dist/esm/types/server/context.mjs +0 -0
  103. package/dist/esm/types/server/hooks.mjs +0 -0
  104. package/dist/esm/types/server/index.mjs +0 -0
  105. package/dist/esm/types/server/plugin.mjs +0 -0
  106. package/dist/esm/types/utils.mjs +0 -0
  107. package/dist/esm-node/cli/api.mjs +85 -0
  108. package/dist/esm-node/cli/context.mjs +38 -0
  109. package/dist/esm-node/cli/hooks.mjs +31 -0
  110. package/dist/esm-node/cli/index.mjs +7 -0
  111. package/dist/esm-node/cli/run/config/createLoadedConfig.mjs +53 -0
  112. package/dist/esm-node/cli/run/config/createResolvedConfig.mjs +14 -0
  113. package/dist/esm-node/cli/run/config/loadConfig.mjs +59 -0
  114. package/dist/esm-node/cli/run/create.mjs +150 -0
  115. package/dist/esm-node/cli/run/index.mjs +7 -0
  116. package/dist/esm-node/cli/run/run.mjs +23 -0
  117. package/dist/esm-node/cli/run/utils/checkIsDuplicationPlugin.mjs +11 -0
  118. package/dist/esm-node/cli/run/utils/commander.mjs +16 -0
  119. package/dist/esm-node/cli/run/utils/createFileWatcher.mjs +68 -0
  120. package/dist/esm-node/cli/run/utils/debug.mjs +3 -0
  121. package/dist/esm-node/cli/run/utils/initAppDir.mjs +11 -0
  122. package/dist/esm-node/cli/run/utils/mergeConfig.mjs +32 -0
  123. package/dist/esm-node/hooks.mjs +120 -0
  124. package/dist/esm-node/index.mjs +3 -0
  125. package/dist/esm-node/manager.mjs +101 -0
  126. package/dist/esm-node/runtime/api.mjs +61 -0
  127. package/dist/esm-node/runtime/context.mjs +23 -0
  128. package/dist/esm-node/runtime/hooks.mjs +12 -0
  129. package/dist/esm-node/runtime/index.mjs +5 -0
  130. package/dist/esm-node/runtime/run/create.mjs +45 -0
  131. package/dist/esm-node/runtime/run/index.mjs +3 -0
  132. package/dist/esm-node/runtime/run/types.mjs +0 -0
  133. package/dist/esm-node/server/api.mjs +59 -0
  134. package/dist/esm-node/server/context.mjs +38 -0
  135. package/dist/esm-node/server/hooks.mjs +9 -0
  136. package/dist/esm-node/server/index.mjs +5 -0
  137. package/dist/esm-node/server/run/create.mjs +45 -0
  138. package/dist/esm-node/server/run/index.mjs +3 -0
  139. package/dist/esm-node/server/run/types.mjs +0 -0
  140. package/dist/esm-node/types/cli/api.mjs +0 -0
  141. package/dist/esm-node/types/cli/context.mjs +0 -0
  142. package/dist/esm-node/types/cli/hooks.mjs +0 -0
  143. package/dist/esm-node/types/cli/index.mjs +0 -0
  144. package/dist/esm-node/types/cli/plugin.mjs +0 -0
  145. package/dist/esm-node/types/hooks.mjs +0 -0
  146. package/dist/esm-node/types/index.mjs +0 -0
  147. package/dist/esm-node/types/plugin.mjs +0 -0
  148. package/dist/esm-node/types/runtime/api.mjs +0 -0
  149. package/dist/esm-node/types/runtime/context.mjs +0 -0
  150. package/dist/esm-node/types/runtime/hooks.mjs +0 -0
  151. package/dist/esm-node/types/runtime/index.mjs +0 -0
  152. package/dist/esm-node/types/runtime/plugin.mjs +0 -0
  153. package/dist/esm-node/types/server/api.mjs +0 -0
  154. package/dist/esm-node/types/server/context.mjs +0 -0
  155. package/dist/esm-node/types/server/hooks.mjs +0 -0
  156. package/dist/esm-node/types/server/index.mjs +0 -0
  157. package/dist/esm-node/types/server/plugin.mjs +0 -0
  158. package/dist/esm-node/types/utils.mjs +0 -0
  159. package/dist/types/cli/api.d.ts +8 -0
  160. package/dist/types/cli/context.d.ts +19 -0
  161. package/dist/types/cli/hooks.d.ts +42 -0
  162. package/dist/types/cli/index.d.ts +6 -0
  163. package/dist/types/cli/run/config/createLoadedConfig.d.ts +2 -0
  164. package/dist/types/cli/run/config/createResolvedConfig.d.ts +3 -0
  165. package/dist/types/cli/run/config/loadConfig.d.ts +25 -0
  166. package/dist/types/cli/run/create.d.ts +16 -0
  167. package/dist/types/cli/run/index.d.ts +13 -0
  168. package/dist/types/cli/run/run.d.ts +2 -0
  169. package/dist/types/cli/run/types.d.ts +32 -0
  170. package/dist/types/cli/run/utils/checkIsDuplicationPlugin.d.ts +1 -0
  171. package/dist/types/cli/run/utils/commander.d.ts +5 -0
  172. package/dist/types/cli/run/utils/createFileWatcher.d.ts +3 -0
  173. package/dist/types/cli/run/utils/debug.d.ts +1 -0
  174. package/dist/types/cli/run/utils/initAppDir.d.ts +1 -0
  175. package/dist/types/cli/run/utils/mergeConfig.d.ts +2 -0
  176. package/dist/types/hooks.d.ts +7 -0
  177. package/dist/types/index.d.ts +7 -4
  178. package/dist/types/manager.d.ts +5 -0
  179. package/dist/types/runtime/api.d.ts +9 -0
  180. package/dist/types/runtime/context.d.ts +11 -0
  181. package/dist/types/runtime/hooks.d.ts +2 -0
  182. package/dist/types/runtime/index.d.ts +5 -0
  183. package/dist/types/runtime/run/create.d.ts +7 -0
  184. package/dist/types/runtime/run/index.d.ts +5 -0
  185. package/dist/types/runtime/run/types.d.ts +6 -0
  186. package/dist/types/server/api.d.ts +9 -0
  187. package/dist/types/server/context.d.ts +13 -0
  188. package/dist/types/server/hooks.d.ts +9 -0
  189. package/dist/types/server/index.d.ts +4 -0
  190. package/dist/types/server/run/create.d.ts +7 -0
  191. package/dist/types/server/run/index.d.ts +8 -0
  192. package/dist/types/server/run/types.d.ts +22 -0
  193. package/dist/types/types/cli/api.d.ts +49 -0
  194. package/dist/types/types/cli/context.d.ts +42 -0
  195. package/dist/types/types/cli/hooks.d.ts +72 -0
  196. package/dist/types/types/cli/index.d.ts +4 -0
  197. package/dist/types/types/cli/plugin.d.ts +17 -0
  198. package/dist/types/types/hooks.d.ts +27 -0
  199. package/dist/types/types/index.d.ts +4 -0
  200. package/dist/types/types/plugin.d.ts +46 -0
  201. package/dist/types/types/runtime/api.d.ts +22 -0
  202. package/dist/types/types/runtime/context.d.ts +13 -0
  203. package/dist/types/types/runtime/hooks.d.ts +39 -0
  204. package/dist/types/types/runtime/index.d.ts +4 -0
  205. package/dist/types/types/runtime/plugin.d.ts +14 -0
  206. package/dist/types/types/server/api.d.ts +19 -0
  207. package/dist/types/types/server/context.d.ts +28 -0
  208. package/dist/types/types/server/hooks.d.ts +24 -0
  209. package/dist/types/types/server/index.d.ts +4 -0
  210. package/dist/types/types/server/plugin.d.ts +14 -0
  211. package/dist/types/types/utils.d.ts +7 -0
  212. package/package.json +68 -14
  213. package/rslib.config.mts +4 -0
  214. package/rstest.config.ts +5 -0
  215. package/dist/cjs/farrow-pipeline/context.js +0 -44
  216. package/dist/cjs/farrow-pipeline/counter.js +0 -37
  217. package/dist/cjs/farrow-pipeline/index.js +0 -87
  218. package/dist/cjs/manager/async.js +0 -124
  219. package/dist/cjs/manager/index.js +0 -26
  220. package/dist/cjs/manager/shared.js +0 -60
  221. package/dist/cjs/manager/sync.js +0 -194
  222. package/dist/cjs/manager/types.js +0 -16
  223. package/dist/cjs/waterfall/async.js +0 -68
  224. package/dist/cjs/waterfall/index.js +0 -24
  225. package/dist/cjs/waterfall/sync.js +0 -67
  226. package/dist/cjs/workflow/async.js +0 -60
  227. package/dist/cjs/workflow/index.js +0 -30
  228. package/dist/cjs/workflow/interrupt.js +0 -64
  229. package/dist/cjs/workflow/parallel.js +0 -53
  230. package/dist/cjs/workflow/sync.js +0 -56
  231. package/dist/cjs/workflow/syncParallel.js +0 -55
  232. package/dist/esm/index.js +0 -882
  233. package/dist/esm-node/farrow-pipeline/context.js +0 -20
  234. package/dist/esm-node/farrow-pipeline/counter.js +0 -13
  235. package/dist/esm-node/farrow-pipeline/index.js +0 -60
  236. package/dist/esm-node/index.js +0 -4
  237. package/dist/esm-node/manager/async.js +0 -106
  238. package/dist/esm-node/manager/index.js +0 -3
  239. package/dist/esm-node/manager/shared.js +0 -32
  240. package/dist/esm-node/manager/sync.js +0 -172
  241. package/dist/esm-node/waterfall/async.js +0 -42
  242. package/dist/esm-node/waterfall/index.js +0 -2
  243. package/dist/esm-node/waterfall/sync.js +0 -41
  244. package/dist/esm-node/workflow/async.js +0 -35
  245. package/dist/esm-node/workflow/index.js +0 -5
  246. package/dist/esm-node/workflow/interrupt.js +0 -39
  247. package/dist/esm-node/workflow/parallel.js +0 -28
  248. package/dist/esm-node/workflow/sync.js +0 -31
  249. package/dist/esm-node/workflow/syncParallel.js +0 -30
  250. package/dist/types/farrow-pipeline/context.d.ts +0 -12
  251. package/dist/types/farrow-pipeline/counter.d.ts +0 -11
  252. package/dist/types/farrow-pipeline/index.d.ts +0 -29
  253. package/dist/types/manager/async.d.ts +0 -54
  254. package/dist/types/manager/index.d.ts +0 -3
  255. package/dist/types/manager/shared.d.ts +0 -12
  256. package/dist/types/manager/sync.d.ts +0 -66
  257. package/dist/types/manager/types.d.ts +0 -33
  258. package/dist/types/waterfall/async.d.ts +0 -21
  259. package/dist/types/waterfall/index.d.ts +0 -2
  260. package/dist/types/waterfall/sync.d.ts +0 -20
  261. package/dist/types/workflow/async.d.ts +0 -12
  262. package/dist/types/workflow/index.d.ts +0 -5
  263. package/dist/types/workflow/interrupt.d.ts +0 -12
  264. package/dist/types/workflow/parallel.d.ts +0 -10
  265. package/dist/types/workflow/sync.d.ts +0 -11
  266. package/dist/types/workflow/syncParallel.d.ts +0 -10
  267. /package/dist/esm-node/{manager/types.js → cli/run/types.mjs} +0 -0
package/dist/esm/index.js DELETED
@@ -1,882 +0,0 @@
1
- // src/farrow-pipeline/index.ts
2
- import { _ as _define_property } from "@swc/helpers/_/_define_property";
3
- import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
4
- import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
5
-
6
- // src/farrow-pipeline/context.ts
7
- var createContext = function(value) {
8
- var currentValue = value;
9
- return {
10
- use: function() {
11
- return {
12
- get value() {
13
- return currentValue;
14
- },
15
- set value(v) {
16
- currentValue = v;
17
- }
18
- };
19
- },
20
- get: function() {
21
- return currentValue;
22
- },
23
- set: function(v1) {
24
- currentValue = v1;
25
- }
26
- };
27
- };
28
-
29
- // src/farrow-pipeline/counter.ts
30
- var createCounter = function(callback) {
31
- var dispatch = function(index, input) {
32
- var next = function() {
33
- var nextInput = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : input;
34
- return dispatch(index + 1, nextInput);
35
- };
36
- return callback(index, input, next);
37
- };
38
- return {
39
- start: function(input) {
40
- return dispatch(0, input);
41
- },
42
- dispatch
43
- };
44
- };
45
-
46
- // src/farrow-pipeline/index.ts
47
- var isPipeline = function(input) {
48
- return Boolean(input === null || input === void 0 ? void 0 : input[PipelineSymbol]);
49
- };
50
- var PipelineSymbol = Symbol.for("MODERN_PIPELINE");
51
- var getMiddleware = function(input) {
52
- if (typeof input === "function") {
53
- return input;
54
- } else if (input && typeof input.middleware === "function") {
55
- return input.middleware;
56
- }
57
- throw new Error("".concat(input, " is not a Middleware"));
58
- };
59
- var createPipeline = function() {
60
- var middlewares = [];
61
- var use = function() {
62
- for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {
63
- inputs[_key] = arguments[_key];
64
- }
65
- var _middlewares;
66
- (_middlewares = middlewares).push.apply(_middlewares, _to_consumable_array(inputs.map(getMiddleware)));
67
- return pipeline;
68
- };
69
- var createCurrentCounter = function(onLast) {
70
- return createCounter(function(index, input, next) {
71
- if (index >= middlewares.length) {
72
- if (onLast) {
73
- return onLast(input);
74
- }
75
- throw new Error("Expect returning a value, but all middlewares just calling next()");
76
- }
77
- return middlewares[index](input, next);
78
- });
79
- };
80
- var currentCounter = createCurrentCounter();
81
- var getCounter = function(options) {
82
- if (!options) {
83
- return currentCounter;
84
- }
85
- return createCurrentCounter(options === null || options === void 0 ? void 0 : options.onLast);
86
- };
87
- var run = function(input, options) {
88
- return getCounter(options).start(input);
89
- };
90
- var middleware = function(input, next) {
91
- return run(input, {
92
- onLast: next
93
- });
94
- };
95
- var _obj;
96
- var pipeline = (_obj = {}, _define_property(_obj, PipelineSymbol, true), _define_property(_obj, "use", use), _define_property(_obj, "run", run), _define_property(_obj, "middleware", middleware), _obj);
97
- return pipeline;
98
- };
99
- var createAsyncPipeline = function() {
100
- var pipeline = createPipeline();
101
- return _object_spread({}, pipeline);
102
- };
103
-
104
- // src/waterfall/sync.ts
105
- import { _ as _define_property2 } from "@swc/helpers/_/_define_property";
106
- import { _ as _object_spread2 } from "@swc/helpers/_/_object_spread";
107
- import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
108
- import { _ as _to_consumable_array2 } from "@swc/helpers/_/_to_consumable_array";
109
- var WATERFALL_SYMBOL = Symbol.for("MODERN_WATERFALL");
110
- var getBrook = function(input) {
111
- if (typeof input === "function") {
112
- return input;
113
- } else if (input && typeof input.middleware === "function") {
114
- return input.middleware;
115
- }
116
- throw new Error("".concat(input, " is not a Brook or { brook: Brook }"));
117
- };
118
- var createWaterfall = function() {
119
- var pipeline = createPipeline();
120
- var use = function() {
121
- for (var _len = arguments.length, brooks = new Array(_len), _key = 0; _key < _len; _key++) {
122
- brooks[_key] = arguments[_key];
123
- }
124
- var _pipeline;
125
- (_pipeline = pipeline).use.apply(_pipeline, _to_consumable_array2(brooks.map(getBrook).map(mapBrookToMiddleware)));
126
- return waterfall;
127
- };
128
- var run = function(input, options) {
129
- return pipeline.run(input, _object_spread_props(_object_spread2({}, options), {
130
- onLast: function(input2) {
131
- return input2;
132
- }
133
- }));
134
- };
135
- var middleware = function(input) {
136
- return pipeline.run(input, {
137
- onLast: function(input2) {
138
- return input2;
139
- }
140
- });
141
- };
142
- var waterfall = _object_spread_props(_object_spread2({}, pipeline), _define_property2({
143
- use,
144
- run,
145
- middleware
146
- }, WATERFALL_SYMBOL, true));
147
- return waterfall;
148
- };
149
- var isWaterfall = function(input) {
150
- return Boolean(input === null || input === void 0 ? void 0 : input[WATERFALL_SYMBOL]);
151
- };
152
- var mapBrookToMiddleware = function(brook) {
153
- return function(input, next) {
154
- return next(brook(input));
155
- };
156
- };
157
-
158
- // src/waterfall/async.ts
159
- import { _ as _define_property3 } from "@swc/helpers/_/_define_property";
160
- import { _ as _object_spread3 } from "@swc/helpers/_/_object_spread";
161
- import { _ as _object_spread_props2 } from "@swc/helpers/_/_object_spread_props";
162
- import { _ as _to_consumable_array3 } from "@swc/helpers/_/_to_consumable_array";
163
- var ASYNC_WATERFALL_SYMBOL = Symbol.for("MODERN_ASYNC_WATERFALL");
164
- var getAsyncBrook = function(input) {
165
- if (typeof input === "function") {
166
- return input;
167
- }
168
- if (input && typeof input.middleware === "function") {
169
- return input.middleware;
170
- }
171
- throw new Error("".concat(input, " is not a AsyncBrook or { brook: AsyncBrook }"));
172
- };
173
- var createAsyncWaterfall = function() {
174
- var pipeline = createAsyncPipeline();
175
- var use = function() {
176
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
177
- input[_key] = arguments[_key];
178
- }
179
- var _pipeline;
180
- (_pipeline = pipeline).use.apply(_pipeline, _to_consumable_array3(input.map(getAsyncBrook).map(mapAsyncBrookToAsyncMiddleware)));
181
- return waterfall;
182
- };
183
- var run = function(input, options) {
184
- return pipeline.run(input, _object_spread_props2(_object_spread3({}, options), {
185
- onLast: function(input2) {
186
- return input2;
187
- }
188
- }));
189
- };
190
- var middleware = function(input) {
191
- return pipeline.run(input, {
192
- onLast: function(input2) {
193
- return input2;
194
- }
195
- });
196
- };
197
- var waterfall = _object_spread_props2(_object_spread3({}, pipeline), _define_property3({
198
- use,
199
- run,
200
- middleware
201
- }, ASYNC_WATERFALL_SYMBOL, true));
202
- return waterfall;
203
- };
204
- var isAsyncWaterfall = function(input) {
205
- return Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WATERFALL_SYMBOL]);
206
- };
207
- var mapAsyncBrookToAsyncMiddleware = function(brook) {
208
- return function(input, next) {
209
- return Promise.resolve(brook(input)).then(function(result) {
210
- return next(result);
211
- });
212
- };
213
- };
214
-
215
- // src/workflow/sync.ts
216
- import { _ as _define_property4 } from "@swc/helpers/_/_define_property";
217
- import { _ as _object_spread4 } from "@swc/helpers/_/_object_spread";
218
- import { _ as _object_spread_props3 } from "@swc/helpers/_/_object_spread_props";
219
- import { _ as _to_consumable_array4 } from "@swc/helpers/_/_to_consumable_array";
220
- var WORKFLOW_SYMBOL = Symbol.for("MODERN_WORKFLOW");
221
- var createWorkflow = function() {
222
- var pipeline = createPipeline();
223
- var use = function() {
224
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
225
- input[_key] = arguments[_key];
226
- }
227
- var _pipeline;
228
- (_pipeline = pipeline).use.apply(_pipeline, _to_consumable_array4(input.map(mapWorkerToMiddleware)));
229
- return workflow;
230
- };
231
- var run = function(input) {
232
- var result = pipeline.run(input, {
233
- onLast: function() {
234
- return [];
235
- }
236
- });
237
- return result.filter(Boolean);
238
- };
239
- var workflow = _object_spread_props3(_object_spread4({}, pipeline), _define_property4({
240
- use,
241
- run
242
- }, WORKFLOW_SYMBOL, true));
243
- return workflow;
244
- };
245
- var isWorkflow = function(input) {
246
- return Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
247
- };
248
- var mapWorkerToMiddleware = function(worker) {
249
- return function(input, next) {
250
- return [
251
- worker(input)
252
- ].concat(_to_consumable_array4(next(input)));
253
- };
254
- };
255
-
256
- // src/workflow/syncParallel.ts
257
- import { _ as _define_property5 } from "@swc/helpers/_/_define_property";
258
- import { _ as _object_spread5 } from "@swc/helpers/_/_object_spread";
259
- import { _ as _object_spread_props4 } from "@swc/helpers/_/_object_spread_props";
260
- import { _ as _to_consumable_array5 } from "@swc/helpers/_/_to_consumable_array";
261
- var SYNC_PARALLEL_WORKFLOW_SYMBOL = Symbol.for("SYNC_MODERN_PARALLEL_WORKFLOW");
262
- var isSyncParallelWorkflow = function(input) {
263
- return Boolean(input === null || input === void 0 ? void 0 : input[SYNC_PARALLEL_WORKFLOW_SYMBOL]);
264
- };
265
- var createSyncParallelWorkflow = function() {
266
- var pipeline = createPipeline();
267
- var use = function() {
268
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
269
- input[_key] = arguments[_key];
270
- }
271
- var _pipeline;
272
- (_pipeline = pipeline).use.apply(_pipeline, _to_consumable_array5(input.map(mapSyncParallelWorkerToMiddleware)));
273
- return workflow;
274
- };
275
- var run = function(input) {
276
- return pipeline.run(input, {
277
- onLast: function() {
278
- return [];
279
- }
280
- }).filter(function(result) {
281
- return Boolean(result);
282
- });
283
- };
284
- var workflow = _object_spread_props4(_object_spread5({}, pipeline), _define_property5({
285
- run,
286
- use
287
- }, SYNC_PARALLEL_WORKFLOW_SYMBOL, true));
288
- return workflow;
289
- };
290
- var mapSyncParallelWorkerToMiddleware = function(worker) {
291
- return function(input, next) {
292
- return [
293
- worker(input)
294
- ].concat(_to_consumable_array5(next(input)));
295
- };
296
- };
297
-
298
- // src/workflow/parallel.ts
299
- import { _ as _define_property6 } from "@swc/helpers/_/_define_property";
300
- import { _ as _object_spread6 } from "@swc/helpers/_/_object_spread";
301
- import { _ as _object_spread_props5 } from "@swc/helpers/_/_object_spread_props";
302
- import { _ as _to_consumable_array6 } from "@swc/helpers/_/_to_consumable_array";
303
- var PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
304
- var isParallelWorkflow = function(input) {
305
- return Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
306
- };
307
- var createParallelWorkflow = function() {
308
- var pipeline = createPipeline();
309
- var use = function() {
310
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
311
- input[_key] = arguments[_key];
312
- }
313
- var _pipeline;
314
- (_pipeline = pipeline).use.apply(_pipeline, _to_consumable_array6(input.map(mapParallelWorkerToAsyncMiddleware)));
315
- return workflow;
316
- };
317
- var run = function(input) {
318
- return Promise.all(pipeline.run(input, {
319
- onLast: function() {
320
- return [];
321
- }
322
- })).then(function(result) {
323
- return result.filter(Boolean);
324
- });
325
- };
326
- var workflow = _object_spread_props5(_object_spread6({}, pipeline), _define_property6({
327
- run,
328
- use
329
- }, PARALLEL_WORKFLOW_SYMBOL, true));
330
- return workflow;
331
- };
332
- var mapParallelWorkerToAsyncMiddleware = function(worker) {
333
- return function(input, next) {
334
- return [
335
- worker(input)
336
- ].concat(_to_consumable_array6(next(input)));
337
- };
338
- };
339
-
340
- // src/workflow/async.ts
341
- import { _ as _define_property7 } from "@swc/helpers/_/_define_property";
342
- import { _ as _object_spread7 } from "@swc/helpers/_/_object_spread";
343
- import { _ as _object_spread_props6 } from "@swc/helpers/_/_object_spread_props";
344
- import { _ as _to_consumable_array7 } from "@swc/helpers/_/_to_consumable_array";
345
- var ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
346
- var isPromise = function(obj) {
347
- return obj && typeof obj.then === "function";
348
- };
349
- var isAsyncWorkflow = function(input) {
350
- return Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
351
- };
352
- var createAsyncWorkflow = function() {
353
- var pipeline = createAsyncPipeline();
354
- var use = function() {
355
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
356
- input[_key] = arguments[_key];
357
- }
358
- var _pipeline;
359
- (_pipeline = pipeline).use.apply(_pipeline, _to_consumable_array7(input.map(mapAsyncWorkerToAsyncMiddleware)));
360
- return workflow;
361
- };
362
- var run = function(input) {
363
- var result = pipeline.run(input, {
364
- onLast: function() {
365
- return [];
366
- }
367
- });
368
- if (isPromise(result)) {
369
- return result.then(function(result2) {
370
- return result2.filter(Boolean);
371
- });
372
- }
373
- return result.filter(Boolean);
374
- };
375
- var workflow = _object_spread_props6(_object_spread7({}, pipeline), _define_property7({
376
- use,
377
- run
378
- }, ASYNC_WORKFLOW_SYMBOL, true));
379
- return workflow;
380
- };
381
- var mapAsyncWorkerToAsyncMiddleware = function(worker) {
382
- return function(input, next) {
383
- return Promise.resolve(worker(input)).then(function(result) {
384
- return Promise.resolve(next(input)).then(function(nextResult) {
385
- return [
386
- result
387
- ].concat(_to_consumable_array7(nextResult));
388
- });
389
- });
390
- };
391
- };
392
-
393
- // src/workflow/interrupt.ts
394
- import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
395
- import { _ as _define_property8 } from "@swc/helpers/_/_define_property";
396
- import { _ as _object_spread8 } from "@swc/helpers/_/_object_spread";
397
- import { _ as _object_spread_props7 } from "@swc/helpers/_/_object_spread_props";
398
- import { _ as _to_consumable_array8 } from "@swc/helpers/_/_to_consumable_array";
399
- import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
400
- var ASYNC_INTERRUPT_WORKFLOW_SYMBOL = Symbol.for("ASYNC_INTERRUPT_WORKFLOW_SYMBOL");
401
- var isAsyncInterruptWorkflow = function(input) {
402
- return Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_INTERRUPT_WORKFLOW_SYMBOL]);
403
- };
404
- var createAsyncInterruptWorkflow = function() {
405
- var pipeline = createAsyncPipeline();
406
- var use = function() {
407
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
408
- input[_key] = arguments[_key];
409
- }
410
- var _pipeline;
411
- (_pipeline = pipeline).use.apply(_pipeline, _to_consumable_array8(input.map(mapAsyncWorkerToInterruptMiddleware)));
412
- return workflow;
413
- };
414
- var run = function() {
415
- var _ref = _async_to_generator(function(input) {
416
- var result;
417
- return _ts_generator(this, function(_state) {
418
- switch (_state.label) {
419
- case 0:
420
- return [
421
- 4,
422
- pipeline.run(input, {
423
- onLast: function() {
424
- return [];
425
- }
426
- })
427
- ];
428
- case 1:
429
- result = _state.sent();
430
- return [
431
- 2,
432
- result
433
- ];
434
- }
435
- });
436
- });
437
- return function run2(input) {
438
- return _ref.apply(this, arguments);
439
- };
440
- }();
441
- var workflow = _object_spread_props7(_object_spread8({}, pipeline), _define_property8({
442
- use,
443
- run
444
- }, ASYNC_INTERRUPT_WORKFLOW_SYMBOL, true));
445
- return workflow;
446
- };
447
- var mapAsyncWorkerToInterruptMiddleware = function(worker) {
448
- return function() {
449
- var _ref = _async_to_generator(function(input, next) {
450
- var isInterrupted, interrupt, result;
451
- return _ts_generator(this, function(_state) {
452
- switch (_state.label) {
453
- case 0:
454
- isInterrupted = false;
455
- interrupt = function(value) {
456
- isInterrupted = true;
457
- return value;
458
- };
459
- return [
460
- 4,
461
- Promise.resolve(worker(input, interrupt))
462
- ];
463
- case 1:
464
- result = _state.sent();
465
- if (isInterrupted) {
466
- return [
467
- 2,
468
- result
469
- ];
470
- }
471
- return [
472
- 2,
473
- Promise.resolve(next(input))
474
- ];
475
- }
476
- });
477
- });
478
- return function(input, next) {
479
- return _ref.apply(this, arguments);
480
- };
481
- }();
482
- };
483
-
484
- // src/manager/sync.ts
485
- import { _ as _object_spread9 } from "@swc/helpers/_/_object_spread";
486
- import { _ as _object_spread_props8 } from "@swc/helpers/_/_object_spread_props";
487
-
488
- // src/manager/shared.ts
489
- import { _ as _type_of } from "@swc/helpers/_/_type_of";
490
- import { pluginDagSort } from "@modern-js/utils/universal/plugin-dag-sort";
491
- var checkPlugins = function(plugins) {
492
- if (process.env.NODE_ENV !== "production") {
493
- plugins.forEach(function(origin) {
494
- origin.rivals.forEach(function(rival) {
495
- plugins.forEach(function(plugin) {
496
- if (rival === plugin.name) {
497
- throw new Error("".concat(origin.name, " has rival ").concat(plugin.name));
498
- }
499
- });
500
- });
501
- origin.required.forEach(function(required) {
502
- if (!plugins.some(function(plugin) {
503
- return plugin.name === required;
504
- })) {
505
- throw new Error("The plugin: ".concat(required, " is required when plugin: ").concat(origin.name, " is exist."));
506
- }
507
- });
508
- });
509
- }
510
- };
511
- function sortPlugins(input) {
512
- return pluginDagSort(input.slice());
513
- }
514
- var includePlugin = function(plugins, input) {
515
- return plugins.some(function(plugin) {
516
- return plugin.name === input.name;
517
- });
518
- };
519
- var isObject = function(obj) {
520
- return obj !== null && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object";
521
- };
522
- var hasOwnProperty = function(obj, prop) {
523
- return obj.hasOwnProperty(prop);
524
- };
525
-
526
- // src/manager/sync.ts
527
- var SYNC_PLUGIN_SYMBOL = "SYNC_PLUGIN_SYMBOL";
528
- var DEFAULT_OPTIONS = {
529
- name: "untitled",
530
- pre: [],
531
- post: [],
532
- rivals: [],
533
- required: [],
534
- usePlugins: [],
535
- registerHook: {}
536
- };
537
- var createManager = function(hooks, api) {
538
- var index = 0;
539
- var runners;
540
- var currentHooks = _object_spread9({}, hooks);
541
- var useRunner = function() {
542
- return runners;
543
- };
544
- var registerHook = function(extraHooks) {
545
- currentHooks = _object_spread9({}, extraHooks, currentHooks);
546
- };
547
- var isPlugin = function(input) {
548
- return isObject(input) && hasOwnProperty(input, SYNC_PLUGIN_SYMBOL) && input[SYNC_PLUGIN_SYMBOL] === SYNC_PLUGIN_SYMBOL;
549
- };
550
- var pluginAPI = _object_spread_props8(_object_spread9({}, api), {
551
- useHookRunners: useRunner
552
- });
553
- var clone = function(overrideAPI) {
554
- var plugins = [];
555
- var addPlugin = function(plugin) {
556
- if (!includePlugin(plugins, plugin)) {
557
- plugins.push(_object_spread9({}, plugin));
558
- }
559
- };
560
- var usePlugin = function() {
561
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
562
- input[_key] = arguments[_key];
563
- }
564
- input.forEach(function(plugin) {
565
- if (isPlugin(plugin)) {
566
- addPlugin(plugin);
567
- } else if (typeof plugin === "function") {
568
- var options = plugin();
569
- addPlugin(createPlugin(options.setup, options));
570
- } else if (isObject(plugin)) {
571
- addPlugin(createPlugin(plugin.setup, plugin));
572
- } else if (process.env.NODE_ENV !== "production") {
573
- console.warn("Unknown plugin: ".concat(JSON.stringify(plugin)));
574
- }
575
- });
576
- return manager;
577
- };
578
- var createPlugin = function() {
579
- var setup = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {
580
- }, options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
581
- var _options_usePlugins;
582
- if ((_options_usePlugins = options.usePlugins) === null || _options_usePlugins === void 0 ? void 0 : _options_usePlugins.length) {
583
- options.usePlugins.forEach(function(plugin) {
584
- usePlugin(createPlugin(plugin.setup, plugin));
585
- });
586
- }
587
- if (options.registerHook) {
588
- registerHook(options.registerHook);
589
- }
590
- return _object_spread_props8(_object_spread9(_object_spread_props8(_object_spread9({}, DEFAULT_OPTIONS), {
591
- name: "No.".concat(index++, " plugin")
592
- }), options), {
593
- SYNC_PLUGIN_SYMBOL,
594
- setup
595
- });
596
- };
597
- var clear = function() {
598
- plugins = [];
599
- };
600
- var init = function() {
601
- var sortedPlugins = sortPlugins(plugins);
602
- var mergedPluginAPI = _object_spread9({}, pluginAPI, overrideAPI);
603
- checkPlugins(sortedPlugins);
604
- var hooksList = sortedPlugins.map(function(plugin) {
605
- return plugin.setup(mergedPluginAPI);
606
- });
607
- runners = generateRunner(hooksList, currentHooks);
608
- return runners;
609
- };
610
- var run = function(cb) {
611
- return cb();
612
- };
613
- var manager = {
614
- createPlugin,
615
- isPlugin,
616
- usePlugin,
617
- init,
618
- clear,
619
- run,
620
- registerHook,
621
- useRunner,
622
- clone
623
- };
624
- return manager;
625
- };
626
- return clone();
627
- };
628
- var generateRunner = function(hooksList, hooksMap) {
629
- var runner = {};
630
- var cloneShape = cloneHooksMap(hooksMap);
631
- if (hooksMap) {
632
- var _loop = function(key2) {
633
- hooksList.forEach(function(hooks) {
634
- if (hooks === null || hooks === void 0 ? void 0 : hooks[key2]) {
635
- cloneShape[key2].use(hooks[key2]);
636
- }
637
- });
638
- runner[key2] = function(input, options) {
639
- return cloneShape[key2].run(input, _object_spread9({}, options));
640
- };
641
- };
642
- for (var key in cloneShape)
643
- _loop(key);
644
- }
645
- return runner;
646
- };
647
- var cloneHook = function(hook) {
648
- if (isWaterfall(hook)) {
649
- return createWaterfall();
650
- }
651
- if (isAsyncWaterfall(hook)) {
652
- return createAsyncWaterfall();
653
- }
654
- if (isWorkflow(hook)) {
655
- return createWorkflow();
656
- }
657
- if (isAsyncWorkflow(hook)) {
658
- return createAsyncWorkflow();
659
- }
660
- if (isParallelWorkflow(hook)) {
661
- return createParallelWorkflow();
662
- }
663
- if (isAsyncInterruptWorkflow(hook)) {
664
- return createAsyncInterruptWorkflow();
665
- }
666
- if (isSyncParallelWorkflow(hook)) {
667
- return createSyncParallelWorkflow();
668
- }
669
- if (isPipeline(hook)) {
670
- return createPipeline();
671
- }
672
- throw new Error("Unknown hook: ".concat(hook));
673
- };
674
- var cloneHooksMap = function(record) {
675
- if (!record) {
676
- return record;
677
- }
678
- var result = {};
679
- for (var key in record) {
680
- result[key] = cloneHook(record[key]);
681
- }
682
- return result;
683
- };
684
-
685
- // src/manager/async.ts
686
- import { _ as _async_to_generator2 } from "@swc/helpers/_/_async_to_generator";
687
- import { _ as _object_spread10 } from "@swc/helpers/_/_object_spread";
688
- import { _ as _object_spread_props9 } from "@swc/helpers/_/_object_spread_props";
689
- import { _ as _ts_generator2 } from "@swc/helpers/_/_ts_generator";
690
- var ASYNC_PLUGIN_SYMBOL = "ASYNC_PLUGIN_SYMBOL";
691
- var createAsyncManager = function(hooks, api) {
692
- var index = 0;
693
- var runners;
694
- var currentHooks = _object_spread10({}, hooks);
695
- var useRunner = function() {
696
- return runners;
697
- };
698
- var registerHook = function(extraHooks) {
699
- currentHooks = _object_spread10({}, extraHooks, currentHooks);
700
- };
701
- var isPlugin = function(input) {
702
- return isObject(input) && hasOwnProperty(input, ASYNC_PLUGIN_SYMBOL) && input[ASYNC_PLUGIN_SYMBOL] === ASYNC_PLUGIN_SYMBOL;
703
- };
704
- var pluginAPI = _object_spread_props9(_object_spread10({}, api), {
705
- useHookRunners: useRunner
706
- });
707
- var clone = function(overrideAPI) {
708
- var plugins = [];
709
- var addPlugin = function(plugin) {
710
- if (!includePlugin(plugins, plugin)) {
711
- plugins.push(_object_spread10({}, plugin));
712
- }
713
- };
714
- var usePlugin = function() {
715
- for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) {
716
- input[_key] = arguments[_key];
717
- }
718
- input.forEach(function(plugin) {
719
- if (isPlugin(plugin)) {
720
- addPlugin(plugin);
721
- } else if (typeof plugin === "function") {
722
- var options = plugin();
723
- addPlugin(createPlugin(options.setup, options));
724
- } else if (isObject(plugin)) {
725
- addPlugin(createPlugin(plugin.setup, plugin));
726
- } else if (process.env.NODE_ENV !== "production") {
727
- console.warn("Unknown plugin: ".concat(JSON.stringify(plugin)));
728
- }
729
- });
730
- return manager;
731
- };
732
- var createPlugin = function() {
733
- var setup = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {
734
- }, options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
735
- var _options_usePlugins;
736
- if ((_options_usePlugins = options.usePlugins) === null || _options_usePlugins === void 0 ? void 0 : _options_usePlugins.length) {
737
- options.usePlugins.forEach(function(plugin) {
738
- usePlugin(createPlugin(plugin.setup, plugin));
739
- });
740
- }
741
- if (options.registerHook) {
742
- registerHook(options.registerHook);
743
- }
744
- return _object_spread_props9(_object_spread10(_object_spread_props9(_object_spread10({}, DEFAULT_OPTIONS), {
745
- name: "No.".concat(index++, " plugin")
746
- }), options), {
747
- ASYNC_PLUGIN_SYMBOL,
748
- setup
749
- });
750
- };
751
- var clear = function() {
752
- plugins = [];
753
- };
754
- var init = function() {
755
- var _ref = _async_to_generator2(function() {
756
- var sortedPlugins, mergedPluginAPI, hooksList, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, plugin, _, err;
757
- return _ts_generator2(this, function(_state) {
758
- switch (_state.label) {
759
- case 0:
760
- sortedPlugins = sortPlugins(plugins);
761
- mergedPluginAPI = _object_spread10({}, pluginAPI, overrideAPI);
762
- checkPlugins(sortedPlugins);
763
- hooksList = [];
764
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
765
- _state.label = 1;
766
- case 1:
767
- _state.trys.push([
768
- 1,
769
- 6,
770
- 7,
771
- 8
772
- ]);
773
- _iterator = sortedPlugins[Symbol.iterator]();
774
- _state.label = 2;
775
- case 2:
776
- if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
777
- return [
778
- 3,
779
- 5
780
- ];
781
- plugin = _step.value;
782
- _ = hooksList.push;
783
- return [
784
- 4,
785
- plugin.setup(mergedPluginAPI)
786
- ];
787
- case 3:
788
- _.apply(hooksList, [
789
- _state.sent()
790
- ]);
791
- _state.label = 4;
792
- case 4:
793
- _iteratorNormalCompletion = true;
794
- return [
795
- 3,
796
- 2
797
- ];
798
- case 5:
799
- return [
800
- 3,
801
- 8
802
- ];
803
- case 6:
804
- err = _state.sent();
805
- _didIteratorError = true;
806
- _iteratorError = err;
807
- return [
808
- 3,
809
- 8
810
- ];
811
- case 7:
812
- try {
813
- if (!_iteratorNormalCompletion && _iterator.return != null) {
814
- _iterator.return();
815
- }
816
- } finally {
817
- if (_didIteratorError) {
818
- throw _iteratorError;
819
- }
820
- }
821
- return [
822
- 7
823
- ];
824
- case 8:
825
- runners = generateRunner(hooksList, currentHooks);
826
- return [
827
- 2,
828
- runners
829
- ];
830
- }
831
- });
832
- });
833
- return function init2() {
834
- return _ref.apply(this, arguments);
835
- };
836
- }();
837
- var run = function(cb) {
838
- return cb();
839
- };
840
- var manager = {
841
- createPlugin,
842
- isPlugin,
843
- usePlugin,
844
- init,
845
- run,
846
- clear,
847
- clone,
848
- registerHook,
849
- useRunner
850
- };
851
- return manager;
852
- };
853
- return clone();
854
- };
855
- export {
856
- DEFAULT_OPTIONS,
857
- cloneHook,
858
- cloneHooksMap,
859
- createAsyncInterruptWorkflow,
860
- createAsyncManager,
861
- createAsyncPipeline,
862
- createAsyncWaterfall,
863
- createAsyncWorkflow,
864
- createContext,
865
- createManager,
866
- createParallelWorkflow,
867
- createPipeline,
868
- createSyncParallelWorkflow,
869
- createWaterfall,
870
- createWorkflow,
871
- generateRunner,
872
- getAsyncBrook,
873
- getBrook,
874
- isAsyncInterruptWorkflow,
875
- isAsyncWaterfall,
876
- isAsyncWorkflow,
877
- isParallelWorkflow,
878
- isPipeline,
879
- isSyncParallelWorkflow,
880
- isWaterfall,
881
- isWorkflow
882
- };