@modern-js/plugin 2.4.0 → 2.6.0

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 (61) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{js/node → cjs}/farrow-pipeline/pipeline.js +1 -15
  3. package/dist/{js/node → cjs}/manager/async.js +21 -50
  4. package/dist/{js/node → cjs}/manager/sync.js +21 -28
  5. package/dist/{js/node → cjs}/utils/pluginDagSort.js +1 -0
  6. package/dist/{js/node → cjs}/waterfall/async.js +5 -43
  7. package/dist/{js/node → cjs}/waterfall/sync.js +4 -20
  8. package/dist/{js/node → cjs}/workflow/async.js +6 -44
  9. package/dist/{js/node → cjs}/workflow/parallel.js +6 -44
  10. package/dist/{js/node → cjs}/workflow/sync.js +3 -19
  11. package/dist/{js/treeshaking → esm}/manager/async.js +2 -2
  12. package/dist/{js/treeshaking → esm}/manager/sync.js +2 -2
  13. package/dist/{js/treeshaking → esm}/utils/pluginDagSort.js +2 -1
  14. package/dist/{js/modern → esm-node}/farrow-pipeline/pipeline.js +1 -17
  15. package/dist/{js/modern → esm-node}/manager/async.js +21 -52
  16. package/dist/{js/modern → esm-node}/manager/sync.js +21 -30
  17. package/dist/{js/modern → esm-node}/utils/pluginDagSort.js +1 -0
  18. package/dist/esm-node/waterfall/async.js +40 -0
  19. package/dist/esm-node/waterfall/sync.js +36 -0
  20. package/dist/esm-node/workflow/async.js +35 -0
  21. package/dist/esm-node/workflow/parallel.js +25 -0
  22. package/dist/esm-node/workflow/sync.js +26 -0
  23. package/package.json +8 -9
  24. package/dist/js/modern/waterfall/async.js +0 -80
  25. package/dist/js/modern/waterfall/sync.js +0 -54
  26. package/dist/js/modern/workflow/async.js +0 -75
  27. package/dist/js/modern/workflow/parallel.js +0 -65
  28. package/dist/js/modern/workflow/sync.js +0 -44
  29. /package/dist/{js/node → cjs}/farrow-pipeline/context.js +0 -0
  30. /package/dist/{js/node → cjs}/farrow-pipeline/counter.js +0 -0
  31. /package/dist/{js/node → cjs}/farrow-pipeline/index.js +0 -0
  32. /package/dist/{js/node → cjs}/index.js +0 -0
  33. /package/dist/{js/node → cjs}/manager/index.js +0 -0
  34. /package/dist/{js/node → cjs}/manager/shared.js +0 -0
  35. /package/dist/{js/node → cjs}/manager/types.js +0 -0
  36. /package/dist/{js/node → cjs}/waterfall/index.js +0 -0
  37. /package/dist/{js/node → cjs}/workflow/index.js +0 -0
  38. /package/dist/{js/treeshaking → esm}/farrow-pipeline/context.js +0 -0
  39. /package/dist/{js/treeshaking → esm}/farrow-pipeline/counter.js +0 -0
  40. /package/dist/{js/treeshaking → esm}/farrow-pipeline/index.js +0 -0
  41. /package/dist/{js/treeshaking → esm}/farrow-pipeline/pipeline.js +0 -0
  42. /package/dist/{js/treeshaking → esm}/index.js +0 -0
  43. /package/dist/{js/treeshaking → esm}/manager/index.js +0 -0
  44. /package/dist/{js/treeshaking → esm}/manager/shared.js +0 -0
  45. /package/dist/{js/treeshaking → esm}/manager/types.js +0 -0
  46. /package/dist/{js/treeshaking → esm}/waterfall/async.js +0 -0
  47. /package/dist/{js/treeshaking → esm}/waterfall/index.js +0 -0
  48. /package/dist/{js/treeshaking → esm}/waterfall/sync.js +0 -0
  49. /package/dist/{js/treeshaking → esm}/workflow/async.js +0 -0
  50. /package/dist/{js/treeshaking → esm}/workflow/index.js +0 -0
  51. /package/dist/{js/treeshaking → esm}/workflow/parallel.js +0 -0
  52. /package/dist/{js/treeshaking → esm}/workflow/sync.js +0 -0
  53. /package/dist/{js/modern → esm-node}/farrow-pipeline/context.js +0 -0
  54. /package/dist/{js/modern → esm-node}/farrow-pipeline/counter.js +0 -0
  55. /package/dist/{js/modern → esm-node}/farrow-pipeline/index.js +0 -0
  56. /package/dist/{js/modern → esm-node}/index.js +0 -0
  57. /package/dist/{js/modern → esm-node}/manager/index.js +0 -0
  58. /package/dist/{js/modern → esm-node}/manager/shared.js +0 -0
  59. /package/dist/{js/modern → esm-node}/manager/types.js +0 -0
  60. /package/dist/{js/modern → esm-node}/waterfall/index.js +0 -0
  61. /package/dist/{js/modern → esm-node}/workflow/index.js +0 -0
@@ -1,65 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
- import { createPipeline } from "../farrow-pipeline";
41
- const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
42
- const isParallelWorkflow = (input) => Boolean(input == null ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
43
- const createParallelWorkflow = () => {
44
- const pipeline = createPipeline();
45
- const use = (...input) => {
46
- pipeline.use(...input.map(mapParallelWorkerToAsyncMiddleware));
47
- return workflow;
48
- };
49
- const run = (input) => __async(void 0, null, function* () {
50
- return Promise.all(pipeline.run(input, { onLast: () => [] })).then(
51
- (result) => result.filter(Boolean)
52
- );
53
- });
54
- const workflow = __spreadProps(__spreadValues({}, pipeline), {
55
- run,
56
- use,
57
- [PARALLEL_WORKFLOW_SYMBOL]: true
58
- });
59
- return workflow;
60
- };
61
- const mapParallelWorkerToAsyncMiddleware = (worker) => (input, next) => [worker(input), ...next(input)];
62
- export {
63
- createParallelWorkflow,
64
- isParallelWorkflow
65
- };
@@ -1,44 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { createPipeline } from "../farrow-pipeline";
21
- const WORKFLOW_SYMBOL = Symbol.for("MODERN_WORKFLOW");
22
- const createWorkflow = () => {
23
- const pipeline = createPipeline();
24
- const use = (...input) => {
25
- pipeline.use(...input.map(mapWorkerToMiddleware));
26
- return workflow;
27
- };
28
- const run = (input) => {
29
- const result = pipeline.run(input, { onLast: () => [] });
30
- return result.filter(Boolean);
31
- };
32
- const workflow = __spreadProps(__spreadValues({}, pipeline), {
33
- use,
34
- run,
35
- [WORKFLOW_SYMBOL]: true
36
- });
37
- return workflow;
38
- };
39
- const isWorkflow = (input) => Boolean(input == null ? void 0 : input[WORKFLOW_SYMBOL]);
40
- const mapWorkerToMiddleware = (worker) => (input, next) => [worker(input), ...next(input)];
41
- export {
42
- createWorkflow,
43
- isWorkflow
44
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes