@modern-js/plugin 2.69.5 → 3.0.0-alpha.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/cli/api.js +119 -0
- package/dist/cjs/cli/context.js +85 -0
- package/dist/cjs/cli/hooks.js +65 -0
- package/dist/cjs/cli/index.js +68 -0
- package/dist/cjs/cli/run/config/createLoadedConfig.js +87 -0
- package/dist/cjs/cli/run/config/createResolvedConfig.js +48 -0
- package/dist/cjs/cli/run/config/loadConfig.js +113 -0
- package/dist/cjs/cli/run/create.js +187 -0
- package/dist/cjs/cli/run/index.js +56 -0
- package/dist/cjs/cli/run/run.js +57 -0
- package/dist/cjs/cli/run/types.js +18 -0
- package/dist/cjs/cli/run/utils/checkIsDuplicationPlugin.js +45 -0
- package/dist/cjs/cli/run/utils/commander.js +56 -0
- package/dist/cjs/cli/run/utils/createFileWatcher.js +112 -0
- package/dist/cjs/cli/run/utils/debug.js +37 -0
- package/dist/cjs/cli/run/utils/initAppDir.js +55 -0
- package/dist/cjs/cli/run/utils/mergeConfig.js +66 -0
- package/dist/cjs/hooks.js +169 -0
- package/dist/cjs/index.js +53 -26
- package/dist/cjs/manager.js +135 -0
- package/dist/cjs/runtime/api.js +95 -0
- package/dist/cjs/runtime/context.js +60 -0
- package/dist/cjs/runtime/hooks.js +46 -0
- package/dist/cjs/runtime/index.js +51 -0
- package/dist/cjs/runtime/run/create.js +79 -0
- package/dist/cjs/runtime/run/index.js +37 -0
- package/dist/cjs/runtime/run/types.js +18 -0
- package/dist/cjs/server/api.js +96 -0
- package/dist/cjs/server/context.js +75 -0
- package/dist/cjs/server/hooks.js +43 -0
- package/dist/cjs/server/index.js +54 -0
- package/dist/cjs/server/run/create.js +79 -0
- package/dist/cjs/server/run/index.js +40 -0
- package/dist/cjs/server/run/types.js +18 -0
- package/dist/cjs/types/cli/api.js +18 -0
- package/dist/cjs/types/cli/context.js +18 -0
- package/dist/cjs/types/cli/hooks.js +18 -0
- package/dist/cjs/types/cli/index.js +18 -0
- package/dist/cjs/types/cli/plugin.js +18 -0
- package/dist/cjs/types/hooks.js +18 -0
- package/dist/cjs/types/index.js +18 -0
- package/dist/cjs/types/plugin.js +18 -0
- package/dist/cjs/types/runtime/api.js +18 -0
- package/dist/cjs/types/runtime/context.js +18 -0
- package/dist/cjs/types/runtime/hooks.js +18 -0
- package/dist/cjs/types/runtime/index.js +18 -0
- package/dist/cjs/types/runtime/plugin.js +18 -0
- package/dist/cjs/types/server/api.js +18 -0
- package/dist/cjs/types/server/context.js +18 -0
- package/dist/cjs/types/server/hooks.js +18 -0
- package/dist/cjs/types/server/index.js +18 -0
- package/dist/cjs/types/server/plugin.js +18 -0
- package/dist/cjs/types/utils.js +18 -0
- package/dist/esm/cli/api.mjs +85 -0
- package/dist/esm/cli/context.mjs +38 -0
- package/dist/esm/cli/hooks.mjs +31 -0
- package/dist/esm/cli/index.mjs +7 -0
- package/dist/esm/cli/run/config/createLoadedConfig.mjs +53 -0
- package/dist/esm/cli/run/config/createResolvedConfig.mjs +14 -0
- package/dist/esm/cli/run/config/loadConfig.mjs +59 -0
- package/dist/esm/cli/run/create.mjs +150 -0
- package/dist/esm/cli/run/index.mjs +7 -0
- package/dist/esm/cli/run/run.mjs +23 -0
- package/dist/esm/cli/run/types.mjs +0 -0
- package/dist/esm/cli/run/utils/checkIsDuplicationPlugin.mjs +11 -0
- package/dist/esm/cli/run/utils/commander.mjs +16 -0
- package/dist/esm/cli/run/utils/createFileWatcher.mjs +68 -0
- package/dist/esm/cli/run/utils/debug.mjs +3 -0
- package/dist/esm/cli/run/utils/initAppDir.mjs +11 -0
- package/dist/esm/cli/run/utils/mergeConfig.mjs +32 -0
- package/dist/esm/hooks.mjs +120 -0
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/manager.mjs +101 -0
- package/dist/esm/runtime/api.mjs +61 -0
- package/dist/esm/runtime/context.mjs +23 -0
- package/dist/esm/runtime/hooks.mjs +12 -0
- package/dist/esm/runtime/index.mjs +5 -0
- package/dist/esm/runtime/run/create.mjs +45 -0
- package/dist/esm/runtime/run/index.mjs +3 -0
- package/dist/esm/runtime/run/types.mjs +0 -0
- package/dist/esm/server/api.mjs +59 -0
- package/dist/esm/server/context.mjs +38 -0
- package/dist/esm/server/hooks.mjs +9 -0
- package/dist/esm/server/index.mjs +5 -0
- package/dist/esm/server/run/create.mjs +45 -0
- package/dist/esm/server/run/index.mjs +3 -0
- package/dist/esm/server/run/types.mjs +0 -0
- package/dist/esm/types/cli/api.mjs +0 -0
- package/dist/esm/types/cli/context.mjs +0 -0
- package/dist/esm/types/cli/hooks.mjs +0 -0
- package/dist/esm/types/cli/index.mjs +0 -0
- package/dist/esm/types/cli/plugin.mjs +0 -0
- package/dist/esm/types/hooks.mjs +0 -0
- package/dist/esm/types/index.mjs +0 -0
- package/dist/esm/types/plugin.mjs +0 -0
- package/dist/esm/types/runtime/api.mjs +0 -0
- package/dist/esm/types/runtime/context.mjs +0 -0
- package/dist/esm/types/runtime/hooks.mjs +0 -0
- package/dist/esm/types/runtime/index.mjs +0 -0
- package/dist/esm/types/runtime/plugin.mjs +0 -0
- package/dist/esm/types/server/api.mjs +0 -0
- package/dist/esm/types/server/context.mjs +0 -0
- package/dist/esm/types/server/hooks.mjs +0 -0
- package/dist/esm/types/server/index.mjs +0 -0
- package/dist/esm/types/server/plugin.mjs +0 -0
- package/dist/esm/types/utils.mjs +0 -0
- package/dist/esm-node/cli/api.mjs +85 -0
- package/dist/esm-node/cli/context.mjs +38 -0
- package/dist/esm-node/cli/hooks.mjs +31 -0
- package/dist/esm-node/cli/index.mjs +7 -0
- package/dist/esm-node/cli/run/config/createLoadedConfig.mjs +53 -0
- package/dist/esm-node/cli/run/config/createResolvedConfig.mjs +14 -0
- package/dist/esm-node/cli/run/config/loadConfig.mjs +59 -0
- package/dist/esm-node/cli/run/create.mjs +150 -0
- package/dist/esm-node/cli/run/index.mjs +7 -0
- package/dist/esm-node/cli/run/run.mjs +23 -0
- package/dist/esm-node/cli/run/utils/checkIsDuplicationPlugin.mjs +11 -0
- package/dist/esm-node/cli/run/utils/commander.mjs +16 -0
- package/dist/esm-node/cli/run/utils/createFileWatcher.mjs +68 -0
- package/dist/esm-node/cli/run/utils/debug.mjs +3 -0
- package/dist/esm-node/cli/run/utils/initAppDir.mjs +11 -0
- package/dist/esm-node/cli/run/utils/mergeConfig.mjs +32 -0
- package/dist/esm-node/hooks.mjs +120 -0
- package/dist/esm-node/index.mjs +3 -0
- package/dist/esm-node/manager.mjs +101 -0
- package/dist/esm-node/runtime/api.mjs +61 -0
- package/dist/esm-node/runtime/context.mjs +23 -0
- package/dist/esm-node/runtime/hooks.mjs +12 -0
- package/dist/esm-node/runtime/index.mjs +5 -0
- package/dist/esm-node/runtime/run/create.mjs +45 -0
- package/dist/esm-node/runtime/run/index.mjs +3 -0
- package/dist/esm-node/runtime/run/types.mjs +0 -0
- package/dist/esm-node/server/api.mjs +59 -0
- package/dist/esm-node/server/context.mjs +38 -0
- package/dist/esm-node/server/hooks.mjs +9 -0
- package/dist/esm-node/server/index.mjs +5 -0
- package/dist/esm-node/server/run/create.mjs +45 -0
- package/dist/esm-node/server/run/index.mjs +3 -0
- package/dist/esm-node/server/run/types.mjs +0 -0
- package/dist/esm-node/types/cli/api.mjs +0 -0
- package/dist/esm-node/types/cli/context.mjs +0 -0
- package/dist/esm-node/types/cli/hooks.mjs +0 -0
- package/dist/esm-node/types/cli/index.mjs +0 -0
- package/dist/esm-node/types/cli/plugin.mjs +0 -0
- package/dist/esm-node/types/hooks.mjs +0 -0
- package/dist/esm-node/types/index.mjs +0 -0
- package/dist/esm-node/types/plugin.mjs +0 -0
- package/dist/esm-node/types/runtime/api.mjs +0 -0
- package/dist/esm-node/types/runtime/context.mjs +0 -0
- package/dist/esm-node/types/runtime/hooks.mjs +0 -0
- package/dist/esm-node/types/runtime/index.mjs +0 -0
- package/dist/esm-node/types/runtime/plugin.mjs +0 -0
- package/dist/esm-node/types/server/api.mjs +0 -0
- package/dist/esm-node/types/server/context.mjs +0 -0
- package/dist/esm-node/types/server/hooks.mjs +0 -0
- package/dist/esm-node/types/server/index.mjs +0 -0
- package/dist/esm-node/types/server/plugin.mjs +0 -0
- package/dist/esm-node/types/utils.mjs +0 -0
- package/dist/types/cli/api.d.ts +8 -0
- package/dist/types/cli/context.d.ts +19 -0
- package/dist/types/cli/hooks.d.ts +42 -0
- package/dist/types/cli/index.d.ts +6 -0
- package/dist/types/cli/run/config/createLoadedConfig.d.ts +2 -0
- package/dist/types/cli/run/config/createResolvedConfig.d.ts +3 -0
- package/dist/types/cli/run/config/loadConfig.d.ts +25 -0
- package/dist/types/cli/run/create.d.ts +16 -0
- package/dist/types/cli/run/index.d.ts +13 -0
- package/dist/types/cli/run/run.d.ts +2 -0
- package/dist/types/cli/run/types.d.ts +32 -0
- package/dist/types/cli/run/utils/checkIsDuplicationPlugin.d.ts +1 -0
- package/dist/types/cli/run/utils/commander.d.ts +5 -0
- package/dist/types/cli/run/utils/createFileWatcher.d.ts +3 -0
- package/dist/types/cli/run/utils/debug.d.ts +1 -0
- package/dist/types/cli/run/utils/initAppDir.d.ts +1 -0
- package/dist/types/cli/run/utils/mergeConfig.d.ts +2 -0
- package/dist/types/hooks.d.ts +7 -0
- package/dist/types/index.d.ts +7 -4
- package/dist/types/manager.d.ts +5 -0
- package/dist/types/runtime/api.d.ts +9 -0
- package/dist/types/runtime/context.d.ts +11 -0
- package/dist/types/runtime/hooks.d.ts +2 -0
- package/dist/types/runtime/index.d.ts +5 -0
- package/dist/types/runtime/run/create.d.ts +7 -0
- package/dist/types/runtime/run/index.d.ts +5 -0
- package/dist/types/runtime/run/types.d.ts +6 -0
- package/dist/types/server/api.d.ts +9 -0
- package/dist/types/server/context.d.ts +13 -0
- package/dist/types/server/hooks.d.ts +9 -0
- package/dist/types/server/index.d.ts +4 -0
- package/dist/types/server/run/create.d.ts +7 -0
- package/dist/types/server/run/index.d.ts +8 -0
- package/dist/types/server/run/types.d.ts +22 -0
- package/dist/types/types/cli/api.d.ts +49 -0
- package/dist/types/types/cli/context.d.ts +42 -0
- package/dist/types/types/cli/hooks.d.ts +72 -0
- package/dist/types/types/cli/index.d.ts +4 -0
- package/dist/types/types/cli/plugin.d.ts +17 -0
- package/dist/types/types/hooks.d.ts +27 -0
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types/types/plugin.d.ts +46 -0
- package/dist/types/types/runtime/api.d.ts +22 -0
- package/dist/types/types/runtime/context.d.ts +13 -0
- package/dist/types/types/runtime/hooks.d.ts +39 -0
- package/dist/types/types/runtime/index.d.ts +4 -0
- package/dist/types/types/runtime/plugin.d.ts +14 -0
- package/dist/types/types/server/api.d.ts +19 -0
- package/dist/types/types/server/context.d.ts +28 -0
- package/dist/types/types/server/hooks.d.ts +24 -0
- package/dist/types/types/server/index.d.ts +4 -0
- package/dist/types/types/server/plugin.d.ts +14 -0
- package/dist/types/types/utils.d.ts +7 -0
- package/package.json +68 -14
- package/rslib.config.mts +4 -0
- package/rstest.config.ts +5 -0
- package/dist/cjs/farrow-pipeline/context.js +0 -44
- package/dist/cjs/farrow-pipeline/counter.js +0 -37
- package/dist/cjs/farrow-pipeline/index.js +0 -87
- package/dist/cjs/manager/async.js +0 -124
- package/dist/cjs/manager/index.js +0 -26
- package/dist/cjs/manager/shared.js +0 -60
- package/dist/cjs/manager/sync.js +0 -194
- package/dist/cjs/manager/types.js +0 -16
- package/dist/cjs/waterfall/async.js +0 -68
- package/dist/cjs/waterfall/index.js +0 -24
- package/dist/cjs/waterfall/sync.js +0 -67
- package/dist/cjs/workflow/async.js +0 -60
- package/dist/cjs/workflow/index.js +0 -30
- package/dist/cjs/workflow/interrupt.js +0 -64
- package/dist/cjs/workflow/parallel.js +0 -53
- package/dist/cjs/workflow/sync.js +0 -56
- package/dist/cjs/workflow/syncParallel.js +0 -55
- package/dist/esm/index.js +0 -882
- package/dist/esm-node/farrow-pipeline/context.js +0 -20
- package/dist/esm-node/farrow-pipeline/counter.js +0 -13
- package/dist/esm-node/farrow-pipeline/index.js +0 -60
- package/dist/esm-node/index.js +0 -4
- package/dist/esm-node/manager/async.js +0 -106
- package/dist/esm-node/manager/index.js +0 -3
- package/dist/esm-node/manager/shared.js +0 -32
- package/dist/esm-node/manager/sync.js +0 -172
- package/dist/esm-node/waterfall/async.js +0 -42
- package/dist/esm-node/waterfall/index.js +0 -2
- package/dist/esm-node/waterfall/sync.js +0 -41
- package/dist/esm-node/workflow/async.js +0 -35
- package/dist/esm-node/workflow/index.js +0 -5
- package/dist/esm-node/workflow/interrupt.js +0 -39
- package/dist/esm-node/workflow/parallel.js +0 -28
- package/dist/esm-node/workflow/sync.js +0 -31
- package/dist/esm-node/workflow/syncParallel.js +0 -30
- package/dist/types/farrow-pipeline/context.d.ts +0 -12
- package/dist/types/farrow-pipeline/counter.d.ts +0 -11
- package/dist/types/farrow-pipeline/index.d.ts +0 -29
- package/dist/types/manager/async.d.ts +0 -54
- package/dist/types/manager/index.d.ts +0 -3
- package/dist/types/manager/shared.d.ts +0 -12
- package/dist/types/manager/sync.d.ts +0 -66
- package/dist/types/manager/types.d.ts +0 -33
- package/dist/types/waterfall/async.d.ts +0 -21
- package/dist/types/waterfall/index.d.ts +0 -2
- package/dist/types/waterfall/sync.d.ts +0 -20
- package/dist/types/workflow/async.d.ts +0 -12
- package/dist/types/workflow/index.d.ts +0 -5
- package/dist/types/workflow/interrupt.d.ts +0 -12
- package/dist/types/workflow/parallel.d.ts +0 -10
- package/dist/types/workflow/sync.d.ts +0 -11
- package/dist/types/workflow/syncParallel.d.ts +0 -10
- /package/dist/esm-node/{manager/types.js → cli/run/types.mjs} +0 -0
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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) => {
|
|
7
|
-
for (var name in all)
|
|
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 });
|
|
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
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(sync_exports);
|
|
26
|
-
var import_farrow_pipeline = require("../farrow-pipeline");
|
|
27
|
-
const WATERFALL_SYMBOL = Symbol.for("MODERN_WATERFALL");
|
|
28
|
-
const getBrook = (input) => {
|
|
29
|
-
if (typeof input === "function") {
|
|
30
|
-
return input;
|
|
31
|
-
} else if (input && typeof input.middleware === "function") {
|
|
32
|
-
return input.middleware;
|
|
33
|
-
}
|
|
34
|
-
throw new Error(`${input} is not a Brook or { brook: Brook }`);
|
|
35
|
-
};
|
|
36
|
-
const createWaterfall = () => {
|
|
37
|
-
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
|
38
|
-
const use = (...brooks) => {
|
|
39
|
-
pipeline.use(...brooks.map(getBrook).map(mapBrookToMiddleware));
|
|
40
|
-
return waterfall;
|
|
41
|
-
};
|
|
42
|
-
const run = (input, options) => pipeline.run(input, {
|
|
43
|
-
...options,
|
|
44
|
-
onLast: (input2) => input2
|
|
45
|
-
});
|
|
46
|
-
const middleware = (input) => {
|
|
47
|
-
return pipeline.run(input, {
|
|
48
|
-
onLast: (input2) => input2
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
const waterfall = {
|
|
52
|
-
...pipeline,
|
|
53
|
-
use,
|
|
54
|
-
run,
|
|
55
|
-
middleware,
|
|
56
|
-
[WATERFALL_SYMBOL]: true
|
|
57
|
-
};
|
|
58
|
-
return waterfall;
|
|
59
|
-
};
|
|
60
|
-
const isWaterfall = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WATERFALL_SYMBOL]);
|
|
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,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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) => {
|
|
7
|
-
for (var name in all)
|
|
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 });
|
|
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
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(async_exports);
|
|
25
|
-
var import_farrow_pipeline = require("../farrow-pipeline");
|
|
26
|
-
const ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
|
|
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]);
|
|
29
|
-
const createAsyncWorkflow = () => {
|
|
30
|
-
const pipeline = (0, import_farrow_pipeline.createAsyncPipeline)();
|
|
31
|
-
const use = (...input) => {
|
|
32
|
-
pipeline.use(...input.map(mapAsyncWorkerToAsyncMiddleware));
|
|
33
|
-
return workflow;
|
|
34
|
-
};
|
|
35
|
-
const run = (input) => {
|
|
36
|
-
const result = pipeline.run(input, {
|
|
37
|
-
onLast: () => []
|
|
38
|
-
});
|
|
39
|
-
if (isPromise(result)) {
|
|
40
|
-
return result.then((result2) => result2.filter(Boolean));
|
|
41
|
-
}
|
|
42
|
-
return result.filter(Boolean);
|
|
43
|
-
};
|
|
44
|
-
const workflow = {
|
|
45
|
-
...pipeline,
|
|
46
|
-
use,
|
|
47
|
-
run,
|
|
48
|
-
[ASYNC_WORKFLOW_SYMBOL]: true
|
|
49
|
-
};
|
|
50
|
-
return workflow;
|
|
51
|
-
};
|
|
52
|
-
const mapAsyncWorkerToAsyncMiddleware = (worker) => (input, next) => Promise.resolve(worker(input)).then((result) => Promise.resolve(next(input)).then((nextResult) => [
|
|
53
|
-
result,
|
|
54
|
-
...nextResult
|
|
55
|
-
]));
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
createAsyncWorkflow,
|
|
59
|
-
isAsyncWorkflow
|
|
60
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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("./syncParallel"), module.exports);
|
|
20
|
-
__reExport(workflow_exports, require("./parallel"), module.exports);
|
|
21
|
-
__reExport(workflow_exports, require("./async"), module.exports);
|
|
22
|
-
__reExport(workflow_exports, require("./interrupt"), module.exports);
|
|
23
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
-
0 && (module.exports = {
|
|
25
|
-
...require("./sync"),
|
|
26
|
-
...require("./syncParallel"),
|
|
27
|
-
...require("./parallel"),
|
|
28
|
-
...require("./async"),
|
|
29
|
-
...require("./interrupt")
|
|
30
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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) => {
|
|
7
|
-
for (var name in all)
|
|
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 });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var interrupt_exports = {};
|
|
20
|
-
__export(interrupt_exports, {
|
|
21
|
-
createAsyncInterruptWorkflow: () => createAsyncInterruptWorkflow,
|
|
22
|
-
isAsyncInterruptWorkflow: () => isAsyncInterruptWorkflow
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(interrupt_exports);
|
|
25
|
-
var import_farrow_pipeline = require("../farrow-pipeline");
|
|
26
|
-
const ASYNC_INTERRUPT_WORKFLOW_SYMBOL = Symbol.for("ASYNC_INTERRUPT_WORKFLOW_SYMBOL");
|
|
27
|
-
const isAsyncInterruptWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_INTERRUPT_WORKFLOW_SYMBOL]);
|
|
28
|
-
const createAsyncInterruptWorkflow = () => {
|
|
29
|
-
const pipeline = (0, import_farrow_pipeline.createAsyncPipeline)();
|
|
30
|
-
const use = (...input) => {
|
|
31
|
-
pipeline.use(...input.map(mapAsyncWorkerToInterruptMiddleware));
|
|
32
|
-
return workflow;
|
|
33
|
-
};
|
|
34
|
-
const run = async (input) => {
|
|
35
|
-
const result = await pipeline.run(input, {
|
|
36
|
-
onLast: () => []
|
|
37
|
-
});
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
const workflow = {
|
|
41
|
-
...pipeline,
|
|
42
|
-
use,
|
|
43
|
-
run,
|
|
44
|
-
[ASYNC_INTERRUPT_WORKFLOW_SYMBOL]: true
|
|
45
|
-
};
|
|
46
|
-
return workflow;
|
|
47
|
-
};
|
|
48
|
-
const mapAsyncWorkerToInterruptMiddleware = (worker) => async (input, next) => {
|
|
49
|
-
let isInterrupted = false;
|
|
50
|
-
const interrupt = (value) => {
|
|
51
|
-
isInterrupted = true;
|
|
52
|
-
return value;
|
|
53
|
-
};
|
|
54
|
-
const result = await Promise.resolve(worker(input, interrupt));
|
|
55
|
-
if (isInterrupted) {
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
return Promise.resolve(next(input));
|
|
59
|
-
};
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
createAsyncInterruptWorkflow,
|
|
63
|
-
isAsyncInterruptWorkflow
|
|
64
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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) => {
|
|
7
|
-
for (var name in all)
|
|
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 });
|
|
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
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(parallel_exports);
|
|
25
|
-
var import_farrow_pipeline = require("../farrow-pipeline");
|
|
26
|
-
const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
|
27
|
-
const isParallelWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
|
|
28
|
-
const createParallelWorkflow = () => {
|
|
29
|
-
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
|
30
|
-
const use = (...input) => {
|
|
31
|
-
pipeline.use(...input.map(mapParallelWorkerToAsyncMiddleware));
|
|
32
|
-
return workflow;
|
|
33
|
-
};
|
|
34
|
-
const run = (input) => Promise.all(pipeline.run(input, {
|
|
35
|
-
onLast: () => []
|
|
36
|
-
})).then((result) => result.filter(Boolean));
|
|
37
|
-
const workflow = {
|
|
38
|
-
...pipeline,
|
|
39
|
-
run,
|
|
40
|
-
use,
|
|
41
|
-
[PARALLEL_WORKFLOW_SYMBOL]: true
|
|
42
|
-
};
|
|
43
|
-
return workflow;
|
|
44
|
-
};
|
|
45
|
-
const mapParallelWorkerToAsyncMiddleware = (worker) => (input, next) => [
|
|
46
|
-
worker(input),
|
|
47
|
-
...next(input)
|
|
48
|
-
];
|
|
49
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
-
0 && (module.exports = {
|
|
51
|
-
createParallelWorkflow,
|
|
52
|
-
isParallelWorkflow
|
|
53
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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) => {
|
|
7
|
-
for (var name in all)
|
|
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 });
|
|
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
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(sync_exports);
|
|
25
|
-
var import_farrow_pipeline = require("../farrow-pipeline");
|
|
26
|
-
const WORKFLOW_SYMBOL = Symbol.for("MODERN_WORKFLOW");
|
|
27
|
-
const createWorkflow = () => {
|
|
28
|
-
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
|
29
|
-
const use = (...input) => {
|
|
30
|
-
pipeline.use(...input.map(mapWorkerToMiddleware));
|
|
31
|
-
return workflow;
|
|
32
|
-
};
|
|
33
|
-
const run = (input) => {
|
|
34
|
-
const result = pipeline.run(input, {
|
|
35
|
-
onLast: () => []
|
|
36
|
-
});
|
|
37
|
-
return result.filter(Boolean);
|
|
38
|
-
};
|
|
39
|
-
const workflow = {
|
|
40
|
-
...pipeline,
|
|
41
|
-
use,
|
|
42
|
-
run,
|
|
43
|
-
[WORKFLOW_SYMBOL]: true
|
|
44
|
-
};
|
|
45
|
-
return workflow;
|
|
46
|
-
};
|
|
47
|
-
const isWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
|
|
48
|
-
const mapWorkerToMiddleware = (worker) => (input, next) => [
|
|
49
|
-
worker(input),
|
|
50
|
-
...next(input)
|
|
51
|
-
];
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
createWorkflow,
|
|
55
|
-
isWorkflow
|
|
56
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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) => {
|
|
7
|
-
for (var name in all)
|
|
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 });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var syncParallel_exports = {};
|
|
20
|
-
__export(syncParallel_exports, {
|
|
21
|
-
createSyncParallelWorkflow: () => createSyncParallelWorkflow,
|
|
22
|
-
isSyncParallelWorkflow: () => isSyncParallelWorkflow
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(syncParallel_exports);
|
|
25
|
-
var import_farrow_pipeline = require("../farrow-pipeline");
|
|
26
|
-
const SYNC_PARALLEL_WORKFLOW_SYMBOL = Symbol.for("SYNC_MODERN_PARALLEL_WORKFLOW");
|
|
27
|
-
const isSyncParallelWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[SYNC_PARALLEL_WORKFLOW_SYMBOL]);
|
|
28
|
-
const createSyncParallelWorkflow = () => {
|
|
29
|
-
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
|
30
|
-
const use = (...input) => {
|
|
31
|
-
pipeline.use(...input.map(mapSyncParallelWorkerToMiddleware));
|
|
32
|
-
return workflow;
|
|
33
|
-
};
|
|
34
|
-
const run = (input) => {
|
|
35
|
-
return pipeline.run(input, {
|
|
36
|
-
onLast: () => []
|
|
37
|
-
}).filter((result) => Boolean(result));
|
|
38
|
-
};
|
|
39
|
-
const workflow = {
|
|
40
|
-
...pipeline,
|
|
41
|
-
run,
|
|
42
|
-
use,
|
|
43
|
-
[SYNC_PARALLEL_WORKFLOW_SYMBOL]: true
|
|
44
|
-
};
|
|
45
|
-
return workflow;
|
|
46
|
-
};
|
|
47
|
-
const mapSyncParallelWorkerToMiddleware = (worker) => (input, next) => [
|
|
48
|
-
worker(input),
|
|
49
|
-
...next(input)
|
|
50
|
-
];
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
createSyncParallelWorkflow,
|
|
54
|
-
isSyncParallelWorkflow
|
|
55
|
-
});
|