@modern-js/plugin 2.26.0 → 2.28.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/CHANGELOG.md +15 -0
- package/dist/cjs/farrow-pipeline/index.js +4 -2
- package/dist/cjs/manager/sync.js +2 -1
- package/dist/cjs/waterfall/async.js +2 -1
- package/dist/cjs/waterfall/sync.js +2 -1
- package/dist/cjs/workflow/async.js +2 -1
- package/dist/cjs/workflow/parallel.js +2 -1
- package/dist/cjs/workflow/sync.js +2 -1
- package/dist/esm/index.js +16 -8
- package/dist/esm-node/farrow-pipeline/index.js +4 -2
- package/dist/esm-node/manager/sync.js +2 -1
- package/dist/esm-node/waterfall/async.js +2 -1
- package/dist/esm-node/waterfall/sync.js +2 -1
- package/dist/esm-node/workflow/async.js +2 -1
- package/dist/esm-node/workflow/parallel.js +2 -1
- package/dist/esm-node/workflow/sync.js +2 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# @modern-js/plugin
|
2
2
|
|
3
|
+
## 2.28.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [00b58a7]
|
8
|
+
- @modern-js/utils@2.28.0
|
9
|
+
|
10
|
+
## 2.27.0
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- Updated dependencies [91d14b8]
|
15
|
+
- Updated dependencies [6d7104d]
|
16
|
+
- @modern-js/utils@2.27.0
|
17
|
+
|
3
18
|
## 2.26.0
|
4
19
|
|
5
20
|
### Patch Changes
|
@@ -26,7 +26,8 @@ _export(exports, {
|
|
26
26
|
const _context = require("./context");
|
27
27
|
const _counter = require("./counter");
|
28
28
|
const isPipeline = (input) => {
|
29
|
-
|
29
|
+
var _input;
|
30
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PipelineSymbol]);
|
30
31
|
};
|
31
32
|
const PipelineSymbol = Symbol.for("MODERN_PIPELINE");
|
32
33
|
const getMiddleware = (input) => {
|
@@ -56,10 +57,11 @@ const createPipeline = () => {
|
|
56
57
|
};
|
57
58
|
const currentCounter = createCurrentCounter();
|
58
59
|
const getCounter = (options) => {
|
60
|
+
var _options;
|
59
61
|
if (!options) {
|
60
62
|
return currentCounter;
|
61
63
|
}
|
62
|
-
return createCurrentCounter(options === null ||
|
64
|
+
return createCurrentCounter((_options = options) === null || _options === void 0 ? void 0 : _options.onLast);
|
63
65
|
};
|
64
66
|
const run = (input, options) => getCounter(options).start(input);
|
65
67
|
const middleware = (input, next) => run(input, {
|
package/dist/cjs/manager/sync.js
CHANGED
@@ -137,7 +137,8 @@ const generateRunner = (hooksList, hooksMap) => {
|
|
137
137
|
if (hooksMap) {
|
138
138
|
for (const key in cloneShape) {
|
139
139
|
hooksList.forEach((hooks) => {
|
140
|
-
|
140
|
+
var _hooks;
|
141
|
+
if ((_hooks = hooks) === null || _hooks === void 0 ? void 0 : _hooks[key]) {
|
141
142
|
cloneShape[key].use(hooks[key]);
|
142
143
|
}
|
143
144
|
});
|
@@ -56,6 +56,7 @@ const createAsyncWaterfall = () => {
|
|
56
56
|
return waterfall;
|
57
57
|
};
|
58
58
|
const isAsyncWaterfall = (input) => {
|
59
|
-
|
59
|
+
var _input;
|
60
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WATERFALL_SYMBOL]);
|
60
61
|
};
|
61
62
|
const mapAsyncBrookToAsyncMiddleware = (brook) => (input, next) => Promise.resolve(brook(input)).then((result) => next(result));
|
@@ -55,6 +55,7 @@ const createWaterfall = () => {
|
|
55
55
|
return waterfall;
|
56
56
|
};
|
57
57
|
const isWaterfall = (input) => {
|
58
|
-
|
58
|
+
var _input;
|
59
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WATERFALL_SYMBOL]);
|
59
60
|
};
|
60
61
|
const mapBrookToMiddleware = (brook) => (input, next) => next(brook(input));
|
@@ -20,7 +20,8 @@ _export(exports, {
|
|
20
20
|
const _farrowpipeline = require("../farrow-pipeline");
|
21
21
|
const ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
|
22
22
|
const isAsyncWorkflow = (input) => {
|
23
|
-
|
23
|
+
var _input;
|
24
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WORKFLOW_SYMBOL]);
|
24
25
|
};
|
25
26
|
const createAsyncWorkflow = () => {
|
26
27
|
const pipeline = (0, _farrowpipeline.createAsyncPipeline)();
|
@@ -20,7 +20,8 @@ _export(exports, {
|
|
20
20
|
const _farrowpipeline = require("../farrow-pipeline");
|
21
21
|
const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
22
22
|
const isParallelWorkflow = (input) => {
|
23
|
-
|
23
|
+
var _input;
|
24
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PARALLEL_WORKFLOW_SYMBOL]);
|
24
25
|
};
|
25
26
|
const createParallelWorkflow = () => {
|
26
27
|
const pipeline = (0, _farrowpipeline.createPipeline)();
|
@@ -40,7 +40,8 @@ const createWorkflow = () => {
|
|
40
40
|
return workflow;
|
41
41
|
};
|
42
42
|
const isWorkflow = (input) => {
|
43
|
-
|
43
|
+
var _input;
|
44
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WORKFLOW_SYMBOL]);
|
44
45
|
};
|
45
46
|
const mapWorkerToMiddleware = (worker) => (input, next) => [
|
46
47
|
worker(input),
|
package/dist/esm/index.js
CHANGED
@@ -45,7 +45,8 @@ var createCounter = function(callback) {
|
|
45
45
|
|
46
46
|
// src/farrow-pipeline/index.ts
|
47
47
|
var isPipeline = function(input) {
|
48
|
-
|
48
|
+
var _input;
|
49
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PipelineSymbol]);
|
49
50
|
};
|
50
51
|
var PipelineSymbol = Symbol.for("MODERN_PIPELINE");
|
51
52
|
var getMiddleware = function(input) {
|
@@ -79,10 +80,11 @@ var createPipeline = function() {
|
|
79
80
|
};
|
80
81
|
var currentCounter = createCurrentCounter();
|
81
82
|
var getCounter = function(options) {
|
83
|
+
var _options;
|
82
84
|
if (!options) {
|
83
85
|
return currentCounter;
|
84
86
|
}
|
85
|
-
return createCurrentCounter(options === null ||
|
87
|
+
return createCurrentCounter((_options = options) === null || _options === void 0 ? void 0 : _options.onLast);
|
86
88
|
};
|
87
89
|
var run = function(input, options) {
|
88
90
|
return getCounter(options).start(input);
|
@@ -147,7 +149,8 @@ var createWaterfall = function() {
|
|
147
149
|
return waterfall;
|
148
150
|
};
|
149
151
|
var isWaterfall = function(input) {
|
150
|
-
|
152
|
+
var _input;
|
153
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WATERFALL_SYMBOL]);
|
151
154
|
};
|
152
155
|
var mapBrookToMiddleware = function(brook) {
|
153
156
|
return function(input, next) {
|
@@ -202,7 +205,8 @@ var createAsyncWaterfall = function() {
|
|
202
205
|
return waterfall;
|
203
206
|
};
|
204
207
|
var isAsyncWaterfall = function(input) {
|
205
|
-
|
208
|
+
var _input;
|
209
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WATERFALL_SYMBOL]);
|
206
210
|
};
|
207
211
|
var mapAsyncBrookToAsyncMiddleware = function(brook) {
|
208
212
|
return function(input, next) {
|
@@ -243,7 +247,8 @@ var createWorkflow = function() {
|
|
243
247
|
return workflow;
|
244
248
|
};
|
245
249
|
var isWorkflow = function(input) {
|
246
|
-
|
250
|
+
var _input;
|
251
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WORKFLOW_SYMBOL]);
|
247
252
|
};
|
248
253
|
var mapWorkerToMiddleware = function(worker) {
|
249
254
|
return function(input, next) {
|
@@ -260,7 +265,8 @@ import { _ as _object_spread_props4 } from "@swc/helpers/_/_object_spread_props"
|
|
260
265
|
import { _ as _to_consumable_array5 } from "@swc/helpers/_/_to_consumable_array";
|
261
266
|
var PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
262
267
|
var isParallelWorkflow = function(input) {
|
263
|
-
|
268
|
+
var _input;
|
269
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PARALLEL_WORKFLOW_SYMBOL]);
|
264
270
|
};
|
265
271
|
var createParallelWorkflow = function() {
|
266
272
|
var pipeline = createPipeline();
|
@@ -302,7 +308,8 @@ import { _ as _object_spread_props5 } from "@swc/helpers/_/_object_spread_props"
|
|
302
308
|
import { _ as _to_consumable_array6 } from "@swc/helpers/_/_to_consumable_array";
|
303
309
|
var ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
|
304
310
|
var isAsyncWorkflow = function(input) {
|
305
|
-
|
311
|
+
var _input;
|
312
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WORKFLOW_SYMBOL]);
|
306
313
|
};
|
307
314
|
var createAsyncWorkflow = function() {
|
308
315
|
var pipeline = createAsyncPipeline();
|
@@ -497,7 +504,8 @@ var generateRunner = function(hooksList, hooksMap) {
|
|
497
504
|
if (hooksMap) {
|
498
505
|
var _loop = function(key2) {
|
499
506
|
hooksList.forEach(function(hooks) {
|
500
|
-
|
507
|
+
var _hooks;
|
508
|
+
if ((_hooks = hooks) === null || _hooks === void 0 ? void 0 : _hooks[key2]) {
|
501
509
|
cloneShape[key2].use(hooks[key2]);
|
502
510
|
}
|
503
511
|
});
|
@@ -2,7 +2,8 @@ import { createContext } from "./context";
|
|
2
2
|
import { createCounter } from "./counter";
|
3
3
|
export { createContext };
|
4
4
|
export const isPipeline = (input) => {
|
5
|
-
|
5
|
+
var _input;
|
6
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PipelineSymbol]);
|
6
7
|
};
|
7
8
|
const PipelineSymbol = Symbol.for("MODERN_PIPELINE");
|
8
9
|
const getMiddleware = (input) => {
|
@@ -32,10 +33,11 @@ export const createPipeline = () => {
|
|
32
33
|
};
|
33
34
|
const currentCounter = createCurrentCounter();
|
34
35
|
const getCounter = (options) => {
|
36
|
+
var _options;
|
35
37
|
if (!options) {
|
36
38
|
return currentCounter;
|
37
39
|
}
|
38
|
-
return createCurrentCounter(options === null ||
|
40
|
+
return createCurrentCounter((_options = options) === null || _options === void 0 ? void 0 : _options.onLast);
|
39
41
|
};
|
40
42
|
const run = (input, options) => getCounter(options).start(input);
|
41
43
|
const middleware = (input, next) => run(input, {
|
@@ -109,7 +109,8 @@ export const generateRunner = (hooksList, hooksMap) => {
|
|
109
109
|
if (hooksMap) {
|
110
110
|
for (const key in cloneShape) {
|
111
111
|
hooksList.forEach((hooks) => {
|
112
|
-
|
112
|
+
var _hooks;
|
113
|
+
if ((_hooks = hooks) === null || _hooks === void 0 ? void 0 : _hooks[key]) {
|
113
114
|
cloneShape[key].use(hooks[key]);
|
114
115
|
}
|
115
116
|
});
|
@@ -34,6 +34,7 @@ export const createAsyncWaterfall = () => {
|
|
34
34
|
return waterfall;
|
35
35
|
};
|
36
36
|
export const isAsyncWaterfall = (input) => {
|
37
|
-
|
37
|
+
var _input;
|
38
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WATERFALL_SYMBOL]);
|
38
39
|
};
|
39
40
|
const mapAsyncBrookToAsyncMiddleware = (brook) => (input, next) => Promise.resolve(brook(input)).then((result) => next(result));
|
@@ -33,6 +33,7 @@ export const createWaterfall = () => {
|
|
33
33
|
return waterfall;
|
34
34
|
};
|
35
35
|
export const isWaterfall = (input) => {
|
36
|
-
|
36
|
+
var _input;
|
37
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WATERFALL_SYMBOL]);
|
37
38
|
};
|
38
39
|
const mapBrookToMiddleware = (brook) => (input, next) => next(brook(input));
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { createAsyncPipeline } from "../farrow-pipeline";
|
2
2
|
const ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
|
3
3
|
export const isAsyncWorkflow = (input) => {
|
4
|
-
|
4
|
+
var _input;
|
5
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WORKFLOW_SYMBOL]);
|
5
6
|
};
|
6
7
|
export const createAsyncWorkflow = () => {
|
7
8
|
const pipeline = createAsyncPipeline();
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { createPipeline } from "../farrow-pipeline";
|
2
2
|
const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
3
3
|
export const isParallelWorkflow = (input) => {
|
4
|
-
|
4
|
+
var _input;
|
5
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PARALLEL_WORKFLOW_SYMBOL]);
|
5
6
|
};
|
6
7
|
export const createParallelWorkflow = () => {
|
7
8
|
const pipeline = createPipeline();
|
@@ -21,7 +21,8 @@ export const createWorkflow = () => {
|
|
21
21
|
return workflow;
|
22
22
|
};
|
23
23
|
export const isWorkflow = (input) => {
|
24
|
-
|
24
|
+
var _input;
|
25
|
+
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WORKFLOW_SYMBOL]);
|
25
26
|
};
|
26
27
|
const mapWorkerToMiddleware = (worker) => (input, next) => [
|
27
28
|
worker(input),
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.28.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -33,15 +33,15 @@
|
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
35
|
"@swc/helpers": "0.5.1",
|
36
|
-
"@modern-js/utils": "2.
|
36
|
+
"@modern-js/utils": "2.28.0"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
39
|
"@types/jest": "^29",
|
40
40
|
"@types/node": "^14",
|
41
41
|
"typescript": "^5",
|
42
42
|
"jest": "^29",
|
43
|
-
"@scripts/
|
44
|
-
"@scripts/
|
43
|
+
"@scripts/build": "2.28.0",
|
44
|
+
"@scripts/jest-config": "2.28.0"
|
45
45
|
},
|
46
46
|
"sideEffects": false,
|
47
47
|
"publishConfig": {
|