@modern-js/plugin 2.3.0 → 2.5.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 (62) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +14 -18
  3. package/dist/{js/node → cjs}/farrow-pipeline/context.js +0 -0
  4. package/dist/{js/node → cjs}/farrow-pipeline/counter.js +0 -0
  5. package/dist/{js/node → cjs}/farrow-pipeline/index.js +0 -0
  6. package/dist/{js/node → cjs}/farrow-pipeline/pipeline.js +1 -15
  7. package/dist/{js/node → cjs}/index.js +0 -0
  8. package/dist/{js/node → cjs}/manager/async.js +21 -50
  9. package/dist/{js/node → cjs}/manager/index.js +0 -0
  10. package/dist/{js/node → cjs}/manager/shared.js +0 -0
  11. package/dist/{js/node → cjs}/manager/sync.js +21 -28
  12. package/dist/{js/node → cjs}/manager/types.js +0 -0
  13. package/dist/{js/node → cjs}/utils/pluginDagSort.js +0 -0
  14. package/dist/{js/node → cjs}/waterfall/async.js +5 -43
  15. package/dist/{js/node → cjs}/waterfall/index.js +0 -0
  16. package/dist/{js/node → cjs}/waterfall/sync.js +4 -20
  17. package/dist/{js/node → cjs}/workflow/async.js +6 -44
  18. package/dist/{js/node → cjs}/workflow/index.js +0 -0
  19. package/dist/{js/node → cjs}/workflow/parallel.js +6 -44
  20. package/dist/{js/node → cjs}/workflow/sync.js +3 -19
  21. package/dist/{js/treeshaking → esm}/farrow-pipeline/context.js +0 -0
  22. package/dist/{js/treeshaking → esm}/farrow-pipeline/counter.js +0 -0
  23. package/dist/{js/treeshaking → esm}/farrow-pipeline/index.js +0 -0
  24. package/dist/{js/treeshaking → esm}/farrow-pipeline/pipeline.js +0 -0
  25. package/dist/{js/treeshaking → esm}/index.js +0 -0
  26. package/dist/{js/treeshaking → esm}/manager/async.js +2 -2
  27. package/dist/{js/treeshaking → esm}/manager/index.js +0 -0
  28. package/dist/{js/treeshaking → esm}/manager/shared.js +0 -0
  29. package/dist/{js/treeshaking → esm}/manager/sync.js +2 -2
  30. package/dist/{js/treeshaking → esm}/manager/types.js +0 -0
  31. package/dist/{js/treeshaking → esm}/utils/pluginDagSort.js +0 -0
  32. package/dist/{js/treeshaking → esm}/waterfall/async.js +0 -0
  33. package/dist/{js/treeshaking → esm}/waterfall/index.js +0 -0
  34. package/dist/{js/treeshaking → esm}/waterfall/sync.js +0 -0
  35. package/dist/{js/treeshaking → esm}/workflow/async.js +0 -0
  36. package/dist/{js/treeshaking → esm}/workflow/index.js +0 -0
  37. package/dist/{js/treeshaking → esm}/workflow/parallel.js +0 -0
  38. package/dist/{js/treeshaking → esm}/workflow/sync.js +0 -0
  39. package/dist/{js/modern → esm-node}/farrow-pipeline/context.js +0 -0
  40. package/dist/{js/modern → esm-node}/farrow-pipeline/counter.js +0 -0
  41. package/dist/{js/modern → esm-node}/farrow-pipeline/index.js +0 -0
  42. package/dist/{js/modern → esm-node}/farrow-pipeline/pipeline.js +1 -17
  43. package/dist/{js/modern → esm-node}/index.js +0 -0
  44. package/dist/{js/modern → esm-node}/manager/async.js +21 -52
  45. package/dist/{js/modern → esm-node}/manager/index.js +0 -0
  46. package/dist/{js/modern → esm-node}/manager/shared.js +0 -0
  47. package/dist/{js/modern → esm-node}/manager/sync.js +21 -30
  48. package/dist/{js/modern → esm-node}/manager/types.js +0 -0
  49. package/dist/{js/modern → esm-node}/utils/pluginDagSort.js +0 -0
  50. package/dist/esm-node/waterfall/async.js +40 -0
  51. package/dist/{js/modern → esm-node}/waterfall/index.js +0 -0
  52. package/dist/esm-node/waterfall/sync.js +36 -0
  53. package/dist/esm-node/workflow/async.js +35 -0
  54. package/dist/{js/modern → esm-node}/workflow/index.js +0 -0
  55. package/dist/esm-node/workflow/parallel.js +25 -0
  56. package/dist/esm-node/workflow/sync.js +26 -0
  57. package/package.json +9 -10
  58. package/dist/js/modern/waterfall/async.js +0 -80
  59. package/dist/js/modern/waterfall/sync.js +0 -54
  60. package/dist/js/modern/workflow/async.js +0 -75
  61. package/dist/js/modern/workflow/parallel.js +0 -65
  62. package/dist/js/modern/workflow/sync.js +0 -44
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @modern-js/plugin
2
2
 
3
+ ## 2.5.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 89ca6cc: refactor: merge build-config into scripts/build
8
+
9
+ refactor: 把 build-config 合并进 scripts/build
10
+
11
+ - 30614fa: chore: modify package.json entry fields and build config
12
+ chore: 更改 package.json entry 字段以及构建配置
13
+
14
+ ## 2.4.0
15
+
3
16
  ## 2.3.0
4
17
 
5
18
  ## 2.2.0
package/README.md CHANGED
@@ -1,30 +1,26 @@
1
-
2
1
  <p align="center">
3
2
  <a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
4
3
  </p>
4
+
5
+ <h1 align="center">Modern.js</h1>
6
+
5
7
  <p align="center">
6
- 现代 Web 工程体系
7
- <br/>
8
- <a href="https://modernjs.dev" target="blank">
9
- modernjs.dev
10
- </a>
11
- </p>
12
- <p align="center">
13
- The meta-framework suite designed from scratch for frontend-focused modern web development
8
+ A Progressive React Framework for modern web development.
14
9
  </p>
15
10
 
16
- # Introduction
17
-
18
- > The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.
11
+ ## Getting Started
19
12
 
20
- - [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)
13
+ Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
21
14
 
22
- ## Getting Started
15
+ ## Documentation
23
16
 
24
- - [Quick Start](https://modernjs.dev/docs/start)
25
- - [Guides](https://modernjs.dev/docs/guides)
26
- - [API References](https://modernjs.dev/docs/apis)
17
+ - [English Documentation](https://modernjs.dev/en/)
18
+ - [中文文档](https://modernjs.dev)
27
19
 
28
20
  ## Contributing
29
21
 
30
- - [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)
22
+ Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
23
+
24
+ ## License
25
+
26
+ Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
File without changes
File without changes
File without changes
@@ -1,21 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
4
  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
5
  var __export = (target, all) => {
20
6
  for (var name in all)
21
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -89,7 +75,7 @@ const createPipeline = () => {
89
75
  };
90
76
  const createAsyncPipeline = () => {
91
77
  const pipeline = createPipeline();
92
- return __spreadValues({}, pipeline);
78
+ return { ...pipeline };
93
79
  };
94
80
  // Annotate the CommonJS export names for ESM import in node:
95
81
  0 && (module.exports = {
File without changes
@@ -1,24 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
5
  var __export = (target, all) => {
23
6
  for (var name in all)
24
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -32,26 +15,6 @@ var __copyProps = (to, from, except, desc) => {
32
15
  return to;
33
16
  };
34
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
- var __async = (__this, __arguments, generator) => {
36
- return new Promise((resolve, reject) => {
37
- var fulfilled = (value) => {
38
- try {
39
- step(generator.next(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var rejected = (value) => {
45
- try {
46
- step(generator.throw(value));
47
- } catch (e) {
48
- reject(e);
49
- }
50
- };
51
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
52
- step((generator = generator.apply(__this, __arguments)).next());
53
- });
54
- };
55
18
  var async_exports = {};
56
19
  __export(async_exports, {
57
20
  createAsyncManager: () => createAsyncManager
@@ -63,20 +26,24 @@ const ASYNC_PLUGIN_SYMBOL = "ASYNC_PLUGIN_SYMBOL";
63
26
  const createAsyncManager = (hooks, api) => {
64
27
  let index = 0;
65
28
  let runners;
66
- let currentHooks = __spreadValues({}, hooks);
29
+ let currentHooks = { ...hooks };
67
30
  const useRunner = () => runners;
68
31
  const registerHook = (extraHooks) => {
69
- currentHooks = __spreadValues(__spreadValues({}, extraHooks), currentHooks);
32
+ currentHooks = {
33
+ ...extraHooks,
34
+ ...currentHooks
35
+ };
70
36
  };
71
37
  const isPlugin = (input) => (0, import_shared.isObject)(input) && (0, import_shared.hasOwnProperty)(input, ASYNC_PLUGIN_SYMBOL) && input[ASYNC_PLUGIN_SYMBOL] === ASYNC_PLUGIN_SYMBOL;
72
- const pluginAPI = __spreadProps(__spreadValues({}, api), {
38
+ const pluginAPI = {
39
+ ...api,
73
40
  useHookRunners: useRunner
74
- });
41
+ };
75
42
  const clone = (overrideAPI) => {
76
43
  let plugins = [];
77
44
  const addPlugin = (plugin) => {
78
45
  if (!(0, import_shared.includePlugin)(plugins, plugin)) {
79
- plugins.push(__spreadValues({}, plugin));
46
+ plugins.push({ ...plugin });
80
47
  }
81
48
  };
82
49
  const usePlugin = (...input) => {
@@ -105,26 +72,30 @@ const createAsyncManager = (hooks, api) => {
105
72
  if (options.registerHook) {
106
73
  registerHook(options.registerHook);
107
74
  }
108
- return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, import_sync.DEFAULT_OPTIONS), {
109
- name: `No.${index++} plugin`
110
- }), options), {
75
+ return {
76
+ ...import_sync.DEFAULT_OPTIONS,
77
+ name: `No.${index++} plugin`,
78
+ ...options,
111
79
  ASYNC_PLUGIN_SYMBOL,
112
80
  setup
113
- });
81
+ };
114
82
  };
115
83
  const clear = () => {
116
84
  plugins = [];
117
85
  };
118
- const init = () => __async(void 0, null, function* () {
86
+ const init = async () => {
119
87
  const sortedPlugins = (0, import_shared.sortPlugins)(plugins);
120
- const mergedPluginAPI = __spreadValues(__spreadValues({}, pluginAPI), overrideAPI);
88
+ const mergedPluginAPI = {
89
+ ...pluginAPI,
90
+ ...overrideAPI
91
+ };
121
92
  (0, import_shared.checkPlugins)(sortedPlugins);
122
- const hooksList = yield Promise.all(
93
+ const hooksList = await Promise.all(
123
94
  sortedPlugins.map((plugin) => plugin.setup(mergedPluginAPI))
124
95
  );
125
96
  runners = (0, import_sync.generateRunner)(hooksList, currentHooks);
126
97
  return runners;
127
- });
98
+ };
128
99
  const run = (cb) => cb();
129
100
  const manager = {
130
101
  createPlugin,
File without changes
File without changes
@@ -1,24 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
5
  var __export = (target, all) => {
23
6
  for (var name in all)
24
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -58,20 +41,24 @@ const DEFAULT_OPTIONS = {
58
41
  const createManager = (hooks, api) => {
59
42
  let index = 0;
60
43
  let runners;
61
- let currentHooks = __spreadValues({}, hooks);
44
+ let currentHooks = { ...hooks };
62
45
  const useRunner = () => runners;
63
46
  const registerHook = (extraHooks) => {
64
- currentHooks = __spreadValues(__spreadValues({}, extraHooks), currentHooks);
47
+ currentHooks = {
48
+ ...extraHooks,
49
+ ...currentHooks
50
+ };
65
51
  };
66
52
  const isPlugin = (input) => (0, import_shared.isObject)(input) && (0, import_shared.hasOwnProperty)(input, SYNC_PLUGIN_SYMBOL) && input[SYNC_PLUGIN_SYMBOL] === SYNC_PLUGIN_SYMBOL;
67
- const pluginAPI = __spreadProps(__spreadValues({}, api), {
53
+ const pluginAPI = {
54
+ ...api,
68
55
  useHookRunners: useRunner
69
- });
56
+ };
70
57
  const clone = (overrideAPI) => {
71
58
  let plugins = [];
72
59
  const addPlugin = (plugin) => {
73
60
  if (!(0, import_shared.includePlugin)(plugins, plugin)) {
74
- plugins.push(__spreadValues({}, plugin));
61
+ plugins.push({ ...plugin });
75
62
  }
76
63
  };
77
64
  const usePlugin = (...input) => {
@@ -100,19 +87,23 @@ const createManager = (hooks, api) => {
100
87
  if (options.registerHook) {
101
88
  registerHook(options.registerHook);
102
89
  }
103
- return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, DEFAULT_OPTIONS), {
104
- name: `No.${index++} plugin`
105
- }), options), {
90
+ return {
91
+ ...DEFAULT_OPTIONS,
92
+ name: `No.${index++} plugin`,
93
+ ...options,
106
94
  SYNC_PLUGIN_SYMBOL,
107
95
  setup
108
- });
96
+ };
109
97
  };
110
98
  const clear = () => {
111
99
  plugins = [];
112
100
  };
113
101
  const init = () => {
114
102
  const sortedPlugins = (0, import_shared.sortPlugins)(plugins);
115
- const mergedPluginAPI = __spreadValues(__spreadValues({}, pluginAPI), overrideAPI);
103
+ const mergedPluginAPI = {
104
+ ...pluginAPI,
105
+ ...overrideAPI
106
+ };
116
107
  (0, import_shared.checkPlugins)(sortedPlugins);
117
108
  const hooksList = sortedPlugins.map(
118
109
  (plugin) => plugin.setup(mergedPluginAPI)
@@ -149,7 +140,9 @@ const generateRunner = (hooksList, hooksMap) => {
149
140
  cloneShape[key].use(hooks[key]);
150
141
  }
151
142
  }
152
- runner[key] = (input, options) => cloneShape[key].run(input, __spreadValues({}, options));
143
+ runner[key] = (input, options) => cloneShape[key].run(input, {
144
+ ...options
145
+ });
153
146
  }
154
147
  }
155
148
  return runner;
File without changes
File without changes
@@ -1,24 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
5
  var __export = (target, all) => {
23
6
  for (var name in all)
24
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -32,26 +15,6 @@ var __copyProps = (to, from, except, desc) => {
32
15
  return to;
33
16
  };
34
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
- var __async = (__this, __arguments, generator) => {
36
- return new Promise((resolve, reject) => {
37
- var fulfilled = (value) => {
38
- try {
39
- step(generator.next(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var rejected = (value) => {
45
- try {
46
- step(generator.throw(value));
47
- } catch (e) {
48
- reject(e);
49
- }
50
- };
51
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
52
- step((generator = generator.apply(__this, __arguments)).next());
53
- });
54
- };
55
18
  var async_exports = {};
56
19
  __export(async_exports, {
57
20
  createAsyncWaterfall: () => createAsyncWaterfall,
@@ -77,22 +40,21 @@ const createAsyncWaterfall = () => {
77
40
  );
78
41
  return waterfall;
79
42
  };
80
- const run = (input, options) => pipeline.run(input, __spreadProps(__spreadValues({}, options), { onLast: (input2) => input2 }));
43
+ const run = (input, options) => pipeline.run(input, { ...options, onLast: (input2) => input2 });
81
44
  const middleware = (input) => {
82
45
  return pipeline.run(input, { onLast: (input2) => input2 });
83
46
  };
84
- const waterfall = __spreadProps(__spreadValues({}, pipeline), {
47
+ const waterfall = {
48
+ ...pipeline,
85
49
  use,
86
50
  run,
87
51
  middleware,
88
52
  [ASYNC_WATERFALL_SYMBOL]: true
89
- });
53
+ };
90
54
  return waterfall;
91
55
  };
92
56
  const isAsyncWaterfall = (input) => Boolean(input == null ? void 0 : input[ASYNC_WATERFALL_SYMBOL]);
93
- const mapAsyncBrookToAsyncMiddleware = (brook) => (input, next) => __async(void 0, null, function* () {
94
- return next(yield brook(input));
95
- });
57
+ const mapAsyncBrookToAsyncMiddleware = (brook) => async (input, next) => next(await brook(input));
96
58
  // Annotate the CommonJS export names for ESM import in node:
97
59
  0 && (module.exports = {
98
60
  createAsyncWaterfall,
File without changes
@@ -1,24 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
5
  var __export = (target, all) => {
23
6
  for (var name in all)
24
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -55,16 +38,17 @@ const createWaterfall = () => {
55
38
  pipeline.use(...brooks.map(getBrook).map(mapBrookToMiddleware));
56
39
  return waterfall;
57
40
  };
58
- const run = (input, options) => pipeline.run(input, __spreadProps(__spreadValues({}, options), { onLast: (input2) => input2 }));
41
+ const run = (input, options) => pipeline.run(input, { ...options, onLast: (input2) => input2 });
59
42
  const middleware = (input) => {
60
43
  return pipeline.run(input, { onLast: (input2) => input2 });
61
44
  };
62
- const waterfall = __spreadProps(__spreadValues({}, pipeline), {
45
+ const waterfall = {
46
+ ...pipeline,
63
47
  use,
64
48
  run,
65
49
  middleware,
66
50
  [WATERFALL_SYMBOL]: true
67
- });
51
+ };
68
52
  return waterfall;
69
53
  };
70
54
  const isWaterfall = (input) => Boolean(input == null ? void 0 : input[WATERFALL_SYMBOL]);
@@ -1,24 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
5
  var __export = (target, all) => {
23
6
  for (var name in all)
24
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -32,26 +15,6 @@ var __copyProps = (to, from, except, desc) => {
32
15
  return to;
33
16
  };
34
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
- var __async = (__this, __arguments, generator) => {
36
- return new Promise((resolve, reject) => {
37
- var fulfilled = (value) => {
38
- try {
39
- step(generator.next(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var rejected = (value) => {
45
- try {
46
- step(generator.throw(value));
47
- } catch (e) {
48
- reject(e);
49
- }
50
- };
51
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
52
- step((generator = generator.apply(__this, __arguments)).next());
53
- });
54
- };
55
18
  var async_exports = {};
56
19
  __export(async_exports, {
57
20
  createAsyncWorkflow: () => createAsyncWorkflow,
@@ -67,24 +30,23 @@ const createAsyncWorkflow = () => {
67
30
  pipeline.use(...input.map(mapAsyncWorkerToAsyncMiddleware));
68
31
  return workflow;
69
32
  };
70
- const run = (input) => __async(void 0, null, function* () {
33
+ const run = async (input) => {
71
34
  const result = pipeline.run(input, { onLast: () => [] });
72
35
  if (isPromise(result)) {
73
36
  return result.then((result2) => result2.filter(Boolean));
74
37
  } else {
75
38
  return result.filter(Boolean);
76
39
  }
77
- });
78
- const workflow = __spreadProps(__spreadValues({}, pipeline), {
40
+ };
41
+ const workflow = {
42
+ ...pipeline,
79
43
  use,
80
44
  run,
81
45
  [ASYNC_WORKFLOW_SYMBOL]: true
82
- });
46
+ };
83
47
  return workflow;
84
48
  };
85
- const mapAsyncWorkerToAsyncMiddleware = (worker) => (input, next) => __async(void 0, null, function* () {
86
- return [yield worker(input), ...yield next(input)];
87
- });
49
+ const mapAsyncWorkerToAsyncMiddleware = (worker) => async (input, next) => [await worker(input), ...await next(input)];
88
50
  function isPromise(obj) {
89
51
  return Boolean(obj) && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
90
52
  }
File without changes
@@ -1,24 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
5
  var __export = (target, all) => {
23
6
  for (var name in all)
24
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -32,26 +15,6 @@ var __copyProps = (to, from, except, desc) => {
32
15
  return to;
33
16
  };
34
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
- var __async = (__this, __arguments, generator) => {
36
- return new Promise((resolve, reject) => {
37
- var fulfilled = (value) => {
38
- try {
39
- step(generator.next(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var rejected = (value) => {
45
- try {
46
- step(generator.throw(value));
47
- } catch (e) {
48
- reject(e);
49
- }
50
- };
51
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
52
- step((generator = generator.apply(__this, __arguments)).next());
53
- });
54
- };
55
18
  var parallel_exports = {};
56
19
  __export(parallel_exports, {
57
20
  createParallelWorkflow: () => createParallelWorkflow,
@@ -67,16 +30,15 @@ const createParallelWorkflow = () => {
67
30
  pipeline.use(...input.map(mapParallelWorkerToAsyncMiddleware));
68
31
  return workflow;
69
32
  };
70
- const run = (input) => __async(void 0, null, function* () {
71
- return Promise.all(pipeline.run(input, { onLast: () => [] })).then(
72
- (result) => result.filter(Boolean)
73
- );
74
- });
75
- const workflow = __spreadProps(__spreadValues({}, pipeline), {
33
+ const run = async (input) => Promise.all(pipeline.run(input, { onLast: () => [] })).then(
34
+ (result) => result.filter(Boolean)
35
+ );
36
+ const workflow = {
37
+ ...pipeline,
76
38
  run,
77
39
  use,
78
40
  [PARALLEL_WORKFLOW_SYMBOL]: true
79
- });
41
+ };
80
42
  return workflow;
81
43
  };
82
44
  const mapParallelWorkerToAsyncMiddleware = (worker) => (input, next) => [worker(input), ...next(input)];
@@ -1,24 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
5
  var __export = (target, all) => {
23
6
  for (var name in all)
24
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -50,11 +33,12 @@ const createWorkflow = () => {
50
33
  const result = pipeline.run(input, { onLast: () => [] });
51
34
  return result.filter(Boolean);
52
35
  };
53
- const workflow = __spreadProps(__spreadValues({}, pipeline), {
36
+ const workflow = {
37
+ ...pipeline,
54
38
  use,
55
39
  run,
56
40
  [WORKFLOW_SYMBOL]: true
57
- });
41
+ };
58
42
  return workflow;
59
43
  };
60
44
  const isWorkflow = (input) => Boolean(input == null ? void 0 : input[WORKFLOW_SYMBOL]);
File without changes