@modern-js/plugin 2.35.0 → 2.36.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.
- package/dist/cjs/farrow-pipeline/context.js +24 -7
- package/dist/cjs/farrow-pipeline/counter.js +24 -7
- package/dist/cjs/farrow-pipeline/index.js +34 -30
- package/dist/cjs/index.js +26 -7
- package/dist/cjs/manager/async.js +39 -20
- package/dist/cjs/manager/index.js +24 -6
- package/dist/cjs/manager/shared.js +33 -26
- package/dist/cjs/manager/sync.js +53 -47
- package/dist/cjs/manager/types.js +15 -3
- package/dist/cjs/waterfall/async.js +30 -24
- package/dist/cjs/waterfall/index.js +22 -5
- package/dist/cjs/waterfall/sync.js +30 -24
- package/dist/cjs/workflow/async.js +29 -24
- package/dist/cjs/workflow/index.js +24 -6
- package/dist/cjs/workflow/parallel.js +28 -21
- package/dist/cjs/workflow/sync.js +28 -21
- package/dist/esm/index.js +129 -63
- package/dist/esm-node/farrow-pipeline/context.js +4 -1
- package/dist/esm-node/farrow-pipeline/counter.js +4 -1
- package/dist/esm-node/farrow-pipeline/index.js +10 -9
- package/dist/esm-node/manager/async.js +11 -6
- package/dist/esm-node/manager/shared.js +12 -5
- package/dist/esm-node/manager/sync.js +13 -7
- package/dist/esm-node/manager/types.js +0 -1
- package/dist/esm-node/waterfall/async.js +8 -6
- package/dist/esm-node/waterfall/sync.js +8 -6
- package/dist/esm-node/workflow/async.js +7 -8
- package/dist/esm-node/workflow/parallel.js +6 -5
- package/dist/esm-node/workflow/sync.js +6 -5
- package/package.json +4 -4
@@ -1,26 +1,29 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
6
7
|
for (var name in all)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return getAsyncBrook;
|
15
|
-
},
|
16
|
-
createAsyncWaterfall: function() {
|
17
|
-
return createAsyncWaterfall;
|
18
|
-
},
|
19
|
-
isAsyncWaterfall: function() {
|
20
|
-
return isAsyncWaterfall;
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
21
15
|
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var async_exports = {};
|
20
|
+
__export(async_exports, {
|
21
|
+
createAsyncWaterfall: () => createAsyncWaterfall,
|
22
|
+
getAsyncBrook: () => getAsyncBrook,
|
23
|
+
isAsyncWaterfall: () => isAsyncWaterfall
|
22
24
|
});
|
23
|
-
|
25
|
+
module.exports = __toCommonJS(async_exports);
|
26
|
+
var import_farrow_pipeline = require("../farrow-pipeline");
|
24
27
|
const ASYNC_WATERFALL_SYMBOL = Symbol.for("MODERN_ASYNC_WATERFALL");
|
25
28
|
const getAsyncBrook = (input) => {
|
26
29
|
if (typeof input === "function") {
|
@@ -32,7 +35,7 @@ const getAsyncBrook = (input) => {
|
|
32
35
|
throw new Error(`${input} is not a AsyncBrook or { brook: AsyncBrook }`);
|
33
36
|
};
|
34
37
|
const createAsyncWaterfall = () => {
|
35
|
-
const pipeline = (0,
|
38
|
+
const pipeline = (0, import_farrow_pipeline.createAsyncPipeline)();
|
36
39
|
const use = (...input) => {
|
37
40
|
pipeline.use(...input.map(getAsyncBrook).map(mapAsyncBrookToAsyncMiddleware));
|
38
41
|
return waterfall;
|
@@ -55,8 +58,11 @@ const createAsyncWaterfall = () => {
|
|
55
58
|
};
|
56
59
|
return waterfall;
|
57
60
|
};
|
58
|
-
const isAsyncWaterfall = (input) =>
|
59
|
-
var _input;
|
60
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WATERFALL_SYMBOL]);
|
61
|
-
};
|
61
|
+
const isAsyncWaterfall = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WATERFALL_SYMBOL]);
|
62
62
|
const mapAsyncBrookToAsyncMiddleware = (brook) => (input, next) => Promise.resolve(brook(input)).then((result) => next(result));
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
64
|
+
0 && (module.exports = {
|
65
|
+
createAsyncWaterfall,
|
66
|
+
getAsyncBrook,
|
67
|
+
isAsyncWaterfall
|
68
|
+
});
|
@@ -1,7 +1,24 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
+
for (let key of __getOwnPropNames(from))
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
+
}
|
12
|
+
return to;
|
13
|
+
};
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
16
|
+
var waterfall_exports = {};
|
17
|
+
module.exports = __toCommonJS(waterfall_exports);
|
18
|
+
__reExport(waterfall_exports, require("./sync"), module.exports);
|
19
|
+
__reExport(waterfall_exports, require("./async"), module.exports);
|
20
|
+
// Annotate the CommonJS export names for ESM import in node:
|
21
|
+
0 && (module.exports = {
|
22
|
+
...require("./sync"),
|
23
|
+
...require("./async")
|
4
24
|
});
|
5
|
-
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
-
_export_star._(require("./sync"), exports);
|
7
|
-
_export_star._(require("./async"), exports);
|
@@ -1,26 +1,29 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
6
7
|
for (var name in all)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return getBrook;
|
15
|
-
},
|
16
|
-
createWaterfall: function() {
|
17
|
-
return createWaterfall;
|
18
|
-
},
|
19
|
-
isWaterfall: function() {
|
20
|
-
return isWaterfall;
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
21
15
|
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var sync_exports = {};
|
20
|
+
__export(sync_exports, {
|
21
|
+
createWaterfall: () => createWaterfall,
|
22
|
+
getBrook: () => getBrook,
|
23
|
+
isWaterfall: () => isWaterfall
|
22
24
|
});
|
23
|
-
|
25
|
+
module.exports = __toCommonJS(sync_exports);
|
26
|
+
var import_farrow_pipeline = require("../farrow-pipeline");
|
24
27
|
const WATERFALL_SYMBOL = Symbol.for("MODERN_WATERFALL");
|
25
28
|
const getBrook = (input) => {
|
26
29
|
if (typeof input === "function") {
|
@@ -31,7 +34,7 @@ const getBrook = (input) => {
|
|
31
34
|
throw new Error(`${input} is not a Brook or { brook: Brook }`);
|
32
35
|
};
|
33
36
|
const createWaterfall = () => {
|
34
|
-
const pipeline = (0,
|
37
|
+
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
35
38
|
const use = (...brooks) => {
|
36
39
|
pipeline.use(...brooks.map(getBrook).map(mapBrookToMiddleware));
|
37
40
|
return waterfall;
|
@@ -54,8 +57,11 @@ const createWaterfall = () => {
|
|
54
57
|
};
|
55
58
|
return waterfall;
|
56
59
|
};
|
57
|
-
const isWaterfall = (input) =>
|
58
|
-
var _input;
|
59
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WATERFALL_SYMBOL]);
|
60
|
-
};
|
60
|
+
const isWaterfall = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WATERFALL_SYMBOL]);
|
61
61
|
const mapBrookToMiddleware = (brook) => (input, next) => next(brook(input));
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
63
|
+
0 && (module.exports = {
|
64
|
+
createWaterfall,
|
65
|
+
getBrook,
|
66
|
+
isWaterfall
|
67
|
+
});
|
@@ -1,30 +1,33 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
6
7
|
for (var name in all)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return isAsyncWorkflow;
|
15
|
-
},
|
16
|
-
createAsyncWorkflow: function() {
|
17
|
-
return createAsyncWorkflow;
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
15
|
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var async_exports = {};
|
20
|
+
__export(async_exports, {
|
21
|
+
createAsyncWorkflow: () => createAsyncWorkflow,
|
22
|
+
isAsyncWorkflow: () => isAsyncWorkflow
|
19
23
|
});
|
20
|
-
|
24
|
+
module.exports = __toCommonJS(async_exports);
|
25
|
+
var import_farrow_pipeline = require("../farrow-pipeline");
|
21
26
|
const ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
|
22
|
-
const
|
23
|
-
|
24
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WORKFLOW_SYMBOL]);
|
25
|
-
};
|
27
|
+
const isPromise = (obj) => obj && typeof obj.then === "function";
|
28
|
+
const isAsyncWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
|
26
29
|
const createAsyncWorkflow = () => {
|
27
|
-
const pipeline = (0,
|
30
|
+
const pipeline = (0, import_farrow_pipeline.createAsyncPipeline)();
|
28
31
|
const use = (...input) => {
|
29
32
|
pipeline.use(...input.map(mapAsyncWorkerToAsyncMiddleware));
|
30
33
|
return workflow;
|
@@ -50,6 +53,8 @@ const mapAsyncWorkerToAsyncMiddleware = (worker) => (input, next) => Promise.res
|
|
50
53
|
result,
|
51
54
|
...nextResult
|
52
55
|
]));
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
57
|
+
0 && (module.exports = {
|
58
|
+
createAsyncWorkflow,
|
59
|
+
isAsyncWorkflow
|
60
|
+
});
|
@@ -1,8 +1,26 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
+
for (let key of __getOwnPropNames(from))
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
+
}
|
12
|
+
return to;
|
13
|
+
};
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
16
|
+
var workflow_exports = {};
|
17
|
+
module.exports = __toCommonJS(workflow_exports);
|
18
|
+
__reExport(workflow_exports, require("./sync"), module.exports);
|
19
|
+
__reExport(workflow_exports, require("./parallel"), module.exports);
|
20
|
+
__reExport(workflow_exports, require("./async"), module.exports);
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
22
|
+
0 && (module.exports = {
|
23
|
+
...require("./sync"),
|
24
|
+
...require("./parallel"),
|
25
|
+
...require("./async")
|
4
26
|
});
|
5
|
-
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
-
_export_star._(require("./sync"), exports);
|
7
|
-
_export_star._(require("./parallel"), exports);
|
8
|
-
_export_star._(require("./async"), exports);
|
@@ -1,30 +1,32 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
6
7
|
for (var name in all)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return isParallelWorkflow;
|
15
|
-
},
|
16
|
-
createParallelWorkflow: function() {
|
17
|
-
return createParallelWorkflow;
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
15
|
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var parallel_exports = {};
|
20
|
+
__export(parallel_exports, {
|
21
|
+
createParallelWorkflow: () => createParallelWorkflow,
|
22
|
+
isParallelWorkflow: () => isParallelWorkflow
|
19
23
|
});
|
20
|
-
|
24
|
+
module.exports = __toCommonJS(parallel_exports);
|
25
|
+
var import_farrow_pipeline = require("../farrow-pipeline");
|
21
26
|
const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
22
|
-
const isParallelWorkflow = (input) =>
|
23
|
-
var _input;
|
24
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PARALLEL_WORKFLOW_SYMBOL]);
|
25
|
-
};
|
27
|
+
const isParallelWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
|
26
28
|
const createParallelWorkflow = () => {
|
27
|
-
const pipeline = (0,
|
29
|
+
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
28
30
|
const use = (...input) => {
|
29
31
|
pipeline.use(...input.map(mapParallelWorkerToAsyncMiddleware));
|
30
32
|
return workflow;
|
@@ -44,3 +46,8 @@ const mapParallelWorkerToAsyncMiddleware = (worker) => (input, next) => [
|
|
44
46
|
worker(input),
|
45
47
|
...next(input)
|
46
48
|
];
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
50
|
+
0 && (module.exports = {
|
51
|
+
createParallelWorkflow,
|
52
|
+
isParallelWorkflow
|
53
|
+
});
|
@@ -1,26 +1,31 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
6
7
|
for (var name in all)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return createWorkflow;
|
15
|
-
},
|
16
|
-
isWorkflow: function() {
|
17
|
-
return isWorkflow;
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
18
15
|
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var sync_exports = {};
|
20
|
+
__export(sync_exports, {
|
21
|
+
createWorkflow: () => createWorkflow,
|
22
|
+
isWorkflow: () => isWorkflow
|
19
23
|
});
|
20
|
-
|
24
|
+
module.exports = __toCommonJS(sync_exports);
|
25
|
+
var import_farrow_pipeline = require("../farrow-pipeline");
|
21
26
|
const WORKFLOW_SYMBOL = Symbol.for("MODERN_WORKFLOW");
|
22
27
|
const createWorkflow = () => {
|
23
|
-
const pipeline = (0,
|
28
|
+
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
24
29
|
const use = (...input) => {
|
25
30
|
pipeline.use(...input.map(mapWorkerToMiddleware));
|
26
31
|
return workflow;
|
@@ -39,11 +44,13 @@ const createWorkflow = () => {
|
|
39
44
|
};
|
40
45
|
return workflow;
|
41
46
|
};
|
42
|
-
const isWorkflow = (input) =>
|
43
|
-
var _input;
|
44
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WORKFLOW_SYMBOL]);
|
45
|
-
};
|
47
|
+
const isWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
|
46
48
|
const mapWorkerToMiddleware = (worker) => (input, next) => [
|
47
49
|
worker(input),
|
48
50
|
...next(input)
|
49
51
|
];
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
53
|
+
0 && (module.exports = {
|
54
|
+
createWorkflow,
|
55
|
+
isWorkflow
|
56
|
+
});
|