@modern-js/plugin 2.17.1 → 2.18.1
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 +12 -0
- package/dist/cjs/manager/shared.js +2 -2
- package/dist/esm/index.js +44 -44
- package/dist/esm-node/manager/shared.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -16,7 +16,7 @@ _export(exports, {
|
|
16
16
|
isObject: () => isObject,
|
17
17
|
hasOwnProperty: () => hasOwnProperty
|
18
18
|
});
|
19
|
-
const
|
19
|
+
const _plugindagsort = require("@modern-js/utils/universal/plugin-dag-sort");
|
20
20
|
const checkPlugins = (plugins) => {
|
21
21
|
if (process.env.NODE_ENV !== "production") {
|
22
22
|
plugins.forEach((origin) => {
|
@@ -36,7 +36,7 @@ const checkPlugins = (plugins) => {
|
|
36
36
|
}
|
37
37
|
};
|
38
38
|
function sortPlugins(input) {
|
39
|
-
return (0,
|
39
|
+
return (0, _plugindagsort.pluginDagSort)(input.slice());
|
40
40
|
}
|
41
41
|
const includePlugin = (plugins, input) => plugins.some((plugin) => plugin.name === input.name);
|
42
42
|
const isObject = (obj) => obj !== null && typeof obj === "object";
|
package/dist/esm/index.js
CHANGED
@@ -34,7 +34,7 @@ var createCounter = function(callback) {
|
|
34
34
|
start: function(input) {
|
35
35
|
return dispatch(0, input);
|
36
36
|
},
|
37
|
-
dispatch
|
37
|
+
dispatch: dispatch
|
38
38
|
};
|
39
39
|
};
|
40
40
|
|
@@ -53,7 +53,7 @@ function _array_without_holes(arr) {
|
|
53
53
|
function _define_property(obj, key, value) {
|
54
54
|
if (key in obj) {
|
55
55
|
Object.defineProperty(obj, key, {
|
56
|
-
value,
|
56
|
+
value: value,
|
57
57
|
enumerable: true,
|
58
58
|
configurable: true,
|
59
59
|
writable: true
|
@@ -173,7 +173,7 @@ function _array_without_holes2(arr) {
|
|
173
173
|
function _define_property2(obj, key, value) {
|
174
174
|
if (key in obj) {
|
175
175
|
Object.defineProperty(obj, key, {
|
176
|
-
value,
|
176
|
+
value: value,
|
177
177
|
enumerable: true,
|
178
178
|
configurable: true,
|
179
179
|
writable: true
|
@@ -279,9 +279,9 @@ var createWaterfall = function() {
|
|
279
279
|
});
|
280
280
|
};
|
281
281
|
var waterfall = _object_spread_props(_object_spread2({}, pipeline), _define_property2({
|
282
|
-
use,
|
283
|
-
run,
|
284
|
-
middleware
|
282
|
+
use: use,
|
283
|
+
run: run,
|
284
|
+
middleware: middleware
|
285
285
|
}, WATERFALL_SYMBOL, true));
|
286
286
|
return waterfall;
|
287
287
|
};
|
@@ -309,7 +309,7 @@ function _array_without_holes3(arr) {
|
|
309
309
|
function _define_property3(obj, key, value) {
|
310
310
|
if (key in obj) {
|
311
311
|
Object.defineProperty(obj, key, {
|
312
|
-
value,
|
312
|
+
value: value,
|
313
313
|
enumerable: true,
|
314
314
|
configurable: true,
|
315
315
|
writable: true
|
@@ -416,9 +416,9 @@ var createAsyncWaterfall = function() {
|
|
416
416
|
});
|
417
417
|
};
|
418
418
|
var waterfall = _object_spread_props2(_object_spread3({}, pipeline), _define_property3({
|
419
|
-
use,
|
420
|
-
run,
|
421
|
-
middleware
|
419
|
+
use: use,
|
420
|
+
run: run,
|
421
|
+
middleware: middleware
|
422
422
|
}, ASYNC_WATERFALL_SYMBOL, true));
|
423
423
|
return waterfall;
|
424
424
|
};
|
@@ -448,7 +448,7 @@ function _array_without_holes4(arr) {
|
|
448
448
|
function _define_property4(obj, key, value) {
|
449
449
|
if (key in obj) {
|
450
450
|
Object.defineProperty(obj, key, {
|
451
|
-
value,
|
451
|
+
value: value,
|
452
452
|
enumerable: true,
|
453
453
|
configurable: true,
|
454
454
|
writable: true
|
@@ -540,8 +540,8 @@ var createWorkflow = function() {
|
|
540
540
|
return result.filter(Boolean);
|
541
541
|
};
|
542
542
|
var workflow = _object_spread_props3(_object_spread4({}, pipeline), _define_property4({
|
543
|
-
use,
|
544
|
-
run
|
543
|
+
use: use,
|
544
|
+
run: run
|
545
545
|
}, WORKFLOW_SYMBOL, true));
|
546
546
|
return workflow;
|
547
547
|
};
|
@@ -571,7 +571,7 @@ function _array_without_holes5(arr) {
|
|
571
571
|
function _define_property5(obj, key, value) {
|
572
572
|
if (key in obj) {
|
573
573
|
Object.defineProperty(obj, key, {
|
574
|
-
value,
|
574
|
+
value: value,
|
575
575
|
enumerable: true,
|
576
576
|
configurable: true,
|
577
577
|
writable: true
|
@@ -667,8 +667,8 @@ var createParallelWorkflow = function() {
|
|
667
667
|
});
|
668
668
|
};
|
669
669
|
var workflow = _object_spread_props4(_object_spread5({}, pipeline), _define_property5({
|
670
|
-
run,
|
671
|
-
use
|
670
|
+
run: run,
|
671
|
+
use: use
|
672
672
|
}, PARALLEL_WORKFLOW_SYMBOL, true));
|
673
673
|
return workflow;
|
674
674
|
};
|
@@ -695,7 +695,7 @@ function _array_without_holes6(arr) {
|
|
695
695
|
function _define_property6(obj, key, value) {
|
696
696
|
if (key in obj) {
|
697
697
|
Object.defineProperty(obj, key, {
|
698
|
-
value,
|
698
|
+
value: value,
|
699
699
|
enumerable: true,
|
700
700
|
configurable: true,
|
701
701
|
writable: true
|
@@ -795,8 +795,8 @@ var createAsyncWorkflow = function() {
|
|
795
795
|
return result.filter(Boolean);
|
796
796
|
};
|
797
797
|
var workflow = _object_spread_props5(_object_spread6({}, pipeline), _define_property6({
|
798
|
-
use,
|
799
|
-
run
|
798
|
+
use: use,
|
799
|
+
run: run
|
800
800
|
}, ASYNC_WORKFLOW_SYMBOL, true));
|
801
801
|
return workflow;
|
802
802
|
};
|
@@ -816,7 +816,7 @@ function isPromise(obj) {
|
|
816
816
|
}
|
817
817
|
|
818
818
|
// src/manager/shared.ts
|
819
|
-
import { pluginDagSort } from "@modern-js/utils/universal/
|
819
|
+
import { pluginDagSort } from "@modern-js/utils/universal/plugin-dag-sort";
|
820
820
|
var checkPlugins = function(plugins) {
|
821
821
|
if (process.env.NODE_ENV !== "production") {
|
822
822
|
plugins.forEach(function(origin) {
|
@@ -856,7 +856,7 @@ var hasOwnProperty = function(obj, prop) {
|
|
856
856
|
function _define_property7(obj, key, value) {
|
857
857
|
if (key in obj) {
|
858
858
|
Object.defineProperty(obj, key, {
|
859
|
-
value,
|
859
|
+
value: value,
|
860
860
|
enumerable: true,
|
861
861
|
configurable: true,
|
862
862
|
writable: true
|
@@ -971,8 +971,8 @@ var createManager = function(hooks, api) {
|
|
971
971
|
return _object_spread_props6(_object_spread7(_object_spread_props6(_object_spread7({}, DEFAULT_OPTIONS), {
|
972
972
|
name: "No.".concat(index++, " plugin")
|
973
973
|
}), options), {
|
974
|
-
SYNC_PLUGIN_SYMBOL,
|
975
|
-
setup
|
974
|
+
SYNC_PLUGIN_SYMBOL: SYNC_PLUGIN_SYMBOL,
|
975
|
+
setup: setup
|
976
976
|
});
|
977
977
|
};
|
978
978
|
var clear = function() {
|
@@ -992,15 +992,15 @@ var createManager = function(hooks, api) {
|
|
992
992
|
return cb();
|
993
993
|
};
|
994
994
|
var manager = {
|
995
|
-
createPlugin,
|
996
|
-
isPlugin,
|
997
|
-
usePlugin,
|
998
|
-
init,
|
999
|
-
clear,
|
1000
|
-
run,
|
1001
|
-
registerHook,
|
1002
|
-
useRunner,
|
1003
|
-
clone
|
995
|
+
createPlugin: createPlugin,
|
996
|
+
isPlugin: isPlugin,
|
997
|
+
usePlugin: usePlugin,
|
998
|
+
init: init,
|
999
|
+
clear: clear,
|
1000
|
+
run: run,
|
1001
|
+
registerHook: registerHook,
|
1002
|
+
useRunner: useRunner,
|
1003
|
+
clone: clone
|
1004
1004
|
};
|
1005
1005
|
return manager;
|
1006
1006
|
};
|
@@ -1061,7 +1061,7 @@ var cloneHooksMap = function(record) {
|
|
1061
1061
|
function _define_property8(obj, key, value) {
|
1062
1062
|
if (key in obj) {
|
1063
1063
|
Object.defineProperty(obj, key, {
|
1064
|
-
value,
|
1064
|
+
value: value,
|
1065
1065
|
enumerable: true,
|
1066
1066
|
configurable: true,
|
1067
1067
|
writable: true
|
@@ -1167,8 +1167,8 @@ var createAsyncManager = function(hooks, api) {
|
|
1167
1167
|
return _object_spread_props7(_object_spread8(_object_spread_props7(_object_spread8({}, DEFAULT_OPTIONS), {
|
1168
1168
|
name: "No.".concat(index++, " plugin")
|
1169
1169
|
}), options), {
|
1170
|
-
ASYNC_PLUGIN_SYMBOL,
|
1171
|
-
setup
|
1170
|
+
ASYNC_PLUGIN_SYMBOL: ASYNC_PLUGIN_SYMBOL,
|
1171
|
+
setup: setup
|
1172
1172
|
});
|
1173
1173
|
};
|
1174
1174
|
var clear = function() {
|
@@ -1189,15 +1189,15 @@ var createAsyncManager = function(hooks, api) {
|
|
1189
1189
|
return cb();
|
1190
1190
|
};
|
1191
1191
|
var manager = {
|
1192
|
-
createPlugin,
|
1193
|
-
isPlugin,
|
1194
|
-
usePlugin,
|
1195
|
-
init,
|
1196
|
-
run,
|
1197
|
-
clear,
|
1198
|
-
clone,
|
1199
|
-
registerHook,
|
1200
|
-
useRunner
|
1192
|
+
createPlugin: createPlugin,
|
1193
|
+
isPlugin: isPlugin,
|
1194
|
+
usePlugin: usePlugin,
|
1195
|
+
init: init,
|
1196
|
+
run: run,
|
1197
|
+
clear: clear,
|
1198
|
+
clone: clone,
|
1199
|
+
registerHook: registerHook,
|
1200
|
+
useRunner: useRunner
|
1201
1201
|
};
|
1202
1202
|
return manager;
|
1203
1203
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { pluginDagSort } from "@modern-js/utils/universal/
|
1
|
+
import { pluginDagSort } from "@modern-js/utils/universal/plugin-dag-sort";
|
2
2
|
export const checkPlugins = (plugins) => {
|
3
3
|
if (process.env.NODE_ENV !== "production") {
|
4
4
|
plugins.forEach((origin) => {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.18.1",
|
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
|
"@babel/runtime": "^7.18.0",
|
36
|
-
"@modern-js/utils": "2.
|
36
|
+
"@modern-js/utils": "2.18.1"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
39
|
"@types/jest": "^29",
|
40
40
|
"@types/node": "^14",
|
41
41
|
"typescript": "^4",
|
42
42
|
"jest": "^29",
|
43
|
-
"@scripts/build": "2.
|
44
|
-
"@scripts/jest-config": "2.
|
43
|
+
"@scripts/build": "2.18.1",
|
44
|
+
"@scripts/jest-config": "2.18.1"
|
45
45
|
},
|
46
46
|
"sideEffects": false,
|
47
47
|
"publishConfig": {
|