@modern-js/plugin 2.0.0-beta.3 → 2.0.0-beta.6

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 (58) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/js/modern/farrow-pipeline/context.js +8 -10
  3. package/dist/js/modern/farrow-pipeline/counter.js +6 -8
  4. package/dist/js/modern/farrow-pipeline/index.js +1 -5
  5. package/dist/js/modern/farrow-pipeline/pipeline.js +37 -21
  6. package/dist/js/modern/index.js +1 -1
  7. package/dist/js/modern/manager/async.js +77 -38
  8. package/dist/js/modern/manager/index.js +1 -1
  9. package/dist/js/modern/manager/shared.js +20 -11
  10. package/dist/js/modern/manager/sync.js +80 -49
  11. package/dist/js/modern/utils/pluginDagSort.js +28 -21
  12. package/dist/js/modern/waterfall/async.js +63 -20
  13. package/dist/js/modern/waterfall/index.js +1 -1
  14. package/dist/js/modern/waterfall/sync.js +35 -18
  15. package/dist/js/modern/workflow/async.js +59 -17
  16. package/dist/js/modern/workflow/index.js +1 -1
  17. package/dist/js/modern/workflow/parallel.js +53 -11
  18. package/dist/js/modern/workflow/sync.js +30 -12
  19. package/dist/js/node/farrow-pipeline/context.js +29 -15
  20. package/dist/js/node/farrow-pipeline/counter.js +27 -13
  21. package/dist/js/node/farrow-pipeline/index.js +17 -16
  22. package/dist/js/node/farrow-pipeline/pipeline.js +59 -30
  23. package/dist/js/node/index.js +20 -49
  24. package/dist/js/node/manager/async.js +94 -47
  25. package/dist/js/node/manager/index.js +19 -38
  26. package/dist/js/node/manager/shared.js +46 -21
  27. package/dist/js/node/manager/sync.js +98 -71
  28. package/dist/js/node/manager/types.js +15 -0
  29. package/dist/js/node/utils/pluginDagSort.js +49 -26
  30. package/dist/js/node/waterfall/async.js +83 -28
  31. package/dist/js/node/waterfall/index.js +18 -27
  32. package/dist/js/node/waterfall/sync.js +58 -27
  33. package/dist/js/node/workflow/async.js +78 -24
  34. package/dist/js/node/workflow/index.js +19 -38
  35. package/dist/js/node/workflow/parallel.js +75 -19
  36. package/dist/js/node/workflow/sync.js +52 -20
  37. package/dist/js/treeshaking/farrow-pipeline/context.js +30 -34
  38. package/dist/js/treeshaking/farrow-pipeline/counter.js +16 -20
  39. package/dist/js/treeshaking/farrow-pipeline/index.js +1 -5
  40. package/dist/js/treeshaking/farrow-pipeline/pipeline.js +106 -59
  41. package/dist/js/treeshaking/index.js +1 -1
  42. package/dist/js/treeshaking/manager/async.js +297 -115
  43. package/dist/js/treeshaking/manager/index.js +1 -1
  44. package/dist/js/treeshaking/manager/shared.js +29 -29
  45. package/dist/js/treeshaking/manager/sync.js +213 -168
  46. package/dist/js/treeshaking/manager/types.js +1 -0
  47. package/dist/js/treeshaking/utils/pluginDagSort.js +67 -72
  48. package/dist/js/treeshaking/waterfall/async.js +266 -68
  49. package/dist/js/treeshaking/waterfall/index.js +1 -1
  50. package/dist/js/treeshaking/waterfall/sync.js +122 -46
  51. package/dist/js/treeshaking/workflow/async.js +285 -84
  52. package/dist/js/treeshaking/workflow/index.js +1 -1
  53. package/dist/js/treeshaking/workflow/parallel.js +244 -49
  54. package/dist/js/treeshaking/workflow/sync.js +110 -32
  55. package/dist/types/manager/async.d.ts +9 -0
  56. package/dist/types/manager/sync.d.ts +9 -0
  57. package/dist/types/manager/types.d.ts +9 -2
  58. package/package.json +3 -3
@@ -1,28 +1,50 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createAsyncPipeline = void 0;
7
- Object.defineProperty(exports, "createContext", {
8
- enumerable: true,
9
- get: function () {
10
- return _context.createContext;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ 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
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
28
  }
29
+ return to;
30
+ };
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+ var pipeline_exports = {};
33
+ __export(pipeline_exports, {
34
+ createAsyncPipeline: () => createAsyncPipeline,
35
+ createContext: () => import_context.createContext,
36
+ createPipeline: () => createPipeline,
37
+ isPipeline: () => isPipeline
12
38
  });
13
- exports.isPipeline = exports.createPipeline = void 0;
14
- var _context = require("./context");
15
- var _counter = require("./counter");
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
- const isPipeline = input => Boolean(input === null || input === void 0 ? void 0 : input[PipelineSymbol]);
20
- exports.isPipeline = isPipeline;
21
- const PipelineSymbol = Symbol.for('MODERN_PIPELINE');
22
- const getMiddleware = input => {
23
- if (typeof input === 'function') {
39
+ module.exports = __toCommonJS(pipeline_exports);
40
+ var import_context = require("./context");
41
+ var import_counter = require("./counter");
42
+ const isPipeline = (input) => Boolean(input == null ? void 0 : input[PipelineSymbol]);
43
+ const PipelineSymbol = Symbol.for("MODERN_PIPELINE");
44
+ const getMiddleware = (input) => {
45
+ if (typeof input === "function") {
24
46
  return input;
25
- } else if (input && typeof input.middleware === 'function') {
47
+ } else if (input && typeof input.middleware === "function") {
26
48
  return input.middleware;
27
49
  }
28
50
  throw new Error(`${input} is not a Middleware`);
@@ -33,23 +55,25 @@ const createPipeline = () => {
33
55
  middlewares.push(...inputs.map(getMiddleware));
34
56
  return pipeline;
35
57
  };
36
- const createCurrentCounter = onLast => {
37
- return (0, _counter.createCounter)((index, input, next) => {
58
+ const createCurrentCounter = (onLast) => {
59
+ return (0, import_counter.createCounter)((index, input, next) => {
38
60
  if (index >= middlewares.length) {
39
61
  if (onLast) {
40
62
  return onLast(input);
41
63
  }
42
- throw new Error(`Expect returning a value, but all middlewares just calling next()`);
64
+ throw new Error(
65
+ `Expect returning a value, but all middlewares just calling next()`
66
+ );
43
67
  }
44
68
  return middlewares[index](input, next);
45
69
  });
46
70
  };
47
71
  const currentCounter = createCurrentCounter();
48
- const getCounter = options => {
72
+ const getCounter = (options) => {
49
73
  if (!options) {
50
74
  return currentCounter;
51
75
  }
52
- return createCurrentCounter(options === null || options === void 0 ? void 0 : options.onLast);
76
+ return createCurrentCounter(options == null ? void 0 : options.onLast);
53
77
  };
54
78
  const run = (input, options) => getCounter(options).start(input);
55
79
  const middleware = (input, next) => run(input, {
@@ -63,9 +87,14 @@ const createPipeline = () => {
63
87
  };
64
88
  return pipeline;
65
89
  };
66
- exports.createPipeline = createPipeline;
67
90
  const createAsyncPipeline = () => {
68
91
  const pipeline = createPipeline();
69
- return _objectSpread({}, pipeline);
92
+ return __spreadValues({}, pipeline);
70
93
  };
71
- exports.createAsyncPipeline = createAsyncPipeline;
94
+ // Annotate the CommonJS export names for ESM import in node:
95
+ 0 && (module.exports = {
96
+ createAsyncPipeline,
97
+ createContext,
98
+ createPipeline,
99
+ isPipeline
100
+ });
@@ -1,49 +1,20 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _farrowPipeline = require("./farrow-pipeline");
7
- Object.keys(_farrowPipeline).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _farrowPipeline[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _farrowPipeline[key];
14
- }
15
- });
16
- });
17
- var _waterfall = require("./waterfall");
18
- Object.keys(_waterfall).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _waterfall[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _waterfall[key];
25
- }
26
- });
27
- });
28
- var _workflow = require("./workflow");
29
- Object.keys(_workflow).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _workflow[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _workflow[key];
36
- }
37
- });
38
- });
39
- var _manager = require("./manager");
40
- Object.keys(_manager).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _manager[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _manager[key];
47
- }
48
- });
49
- });
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var src_exports = {};
16
+ module.exports = __toCommonJS(src_exports);
17
+ __reExport(src_exports, require("./farrow-pipeline"), module.exports);
18
+ __reExport(src_exports, require("./waterfall"), module.exports);
19
+ __reExport(src_exports, require("./workflow"), module.exports);
20
+ __reExport(src_exports, require("./manager"), module.exports);
@@ -1,71 +1,113 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ 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
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") {
28
+ for (let key of __getOwnPropNames(from))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ 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
+ var async_exports = {};
56
+ __export(async_exports, {
57
+ createAsyncManager: () => createAsyncManager
5
58
  });
6
- exports.createAsyncManager = void 0;
7
- var _sync = require("./sync");
8
- var _shared = require("./shared");
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- const ASYNC_PLUGIN_SYMBOL = 'ASYNC_PLUGIN_SYMBOL';
59
+ module.exports = __toCommonJS(async_exports);
60
+ var import_sync = require("./sync");
61
+ var import_shared = require("./shared");
62
+ const ASYNC_PLUGIN_SYMBOL = "ASYNC_PLUGIN_SYMBOL";
13
63
  const createAsyncManager = (hooks, api) => {
14
64
  let index = 0;
15
65
  let runners;
16
- let currentHooks = _objectSpread({}, hooks);
66
+ let currentHooks = __spreadValues({}, hooks);
17
67
  const useRunner = () => runners;
18
- const registerHook = extraHooks => {
19
- currentHooks = _objectSpread(_objectSpread({}, extraHooks), currentHooks);
68
+ const registerHook = (extraHooks) => {
69
+ currentHooks = __spreadValues(__spreadValues({}, extraHooks), currentHooks);
20
70
  };
21
- const isPlugin = input => (0, _shared.isObject)(input) && (0, _shared.hasOwnProperty)(input, ASYNC_PLUGIN_SYMBOL) && input[ASYNC_PLUGIN_SYMBOL] === ASYNC_PLUGIN_SYMBOL;
22
- const pluginAPI = _objectSpread(_objectSpread({}, api), {}, {
71
+ 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), {
23
73
  useHookRunners: useRunner
24
74
  });
25
- const clone = overrideAPI => {
75
+ const clone = (overrideAPI) => {
26
76
  let plugins = [];
27
- const addPlugin = plugin => {
28
- if (!(0, _shared.includePlugin)(plugins, plugin)) {
29
- plugins.push(_objectSpread({}, plugin));
77
+ const addPlugin = (plugin) => {
78
+ if (!(0, import_shared.includePlugin)(plugins, plugin)) {
79
+ plugins.push(__spreadValues({}, plugin));
30
80
  }
31
81
  };
32
82
  const usePlugin = (...input) => {
33
83
  for (const plugin of input) {
34
- // already created by createPlugin
35
84
  if (isPlugin(plugin)) {
36
85
  addPlugin(plugin);
37
- }
38
- // using function to return plugin options
39
- else if (typeof plugin === 'function') {
86
+ } else if (typeof plugin === "function") {
40
87
  const options = plugin();
41
88
  addPlugin(createPlugin(options.setup, options));
42
- }
43
- // plain plugin object
44
- else if ((0, _shared.isObject)(plugin)) {
89
+ } else if ((0, import_shared.isObject)(plugin)) {
45
90
  addPlugin(createPlugin(plugin.setup, plugin));
46
- }
47
- // unknown plugin
48
- else {
91
+ } else {
49
92
  console.warn(`Unknown plugin: ${JSON.stringify(plugin)}`);
50
93
  }
51
94
  }
52
95
  return manager;
53
96
  };
54
- const createPlugin = (
55
- // eslint-disable-next-line @typescript-eslint/no-empty-function
56
- setup = () => {}, options = {}) => {
57
- var _options$usePlugins;
58
- if ((_options$usePlugins = options.usePlugins) !== null && _options$usePlugins !== void 0 && _options$usePlugins.length) {
59
- options.usePlugins.forEach(plugin => {
97
+ const createPlugin = (setup = () => {
98
+ }, options = {}) => {
99
+ var _a;
100
+ if ((_a = options.usePlugins) == null ? void 0 : _a.length) {
101
+ options.usePlugins.forEach((plugin) => {
60
102
  usePlugin(createPlugin(plugin.setup, plugin));
61
103
  });
62
104
  }
63
105
  if (options.registerHook) {
64
106
  registerHook(options.registerHook);
65
107
  }
66
- return _objectSpread(_objectSpread(_objectSpread({}, _sync.DEFAULT_OPTIONS), {}, {
108
+ return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, import_sync.DEFAULT_OPTIONS), {
67
109
  name: `No.${index++} plugin`
68
- }, options), {}, {
110
+ }), options), {
69
111
  ASYNC_PLUGIN_SYMBOL,
70
112
  setup
71
113
  });
@@ -73,15 +115,17 @@ const createAsyncManager = (hooks, api) => {
73
115
  const clear = () => {
74
116
  plugins = [];
75
117
  };
76
- const init = async () => {
77
- const sortedPlugins = (0, _shared.sortPlugins)(plugins);
78
- const mergedPluginAPI = _objectSpread(_objectSpread({}, pluginAPI), overrideAPI);
79
- (0, _shared.checkPlugins)(sortedPlugins);
80
- const hooksList = await Promise.all(sortedPlugins.map(plugin => plugin.setup(mergedPluginAPI)));
81
- runners = (0, _sync.generateRunner)(hooksList, currentHooks);
118
+ const init = () => __async(void 0, null, function* () {
119
+ const sortedPlugins = (0, import_shared.sortPlugins)(plugins);
120
+ const mergedPluginAPI = __spreadValues(__spreadValues({}, pluginAPI), overrideAPI);
121
+ (0, import_shared.checkPlugins)(sortedPlugins);
122
+ const hooksList = yield Promise.all(
123
+ sortedPlugins.map((plugin) => plugin.setup(mergedPluginAPI))
124
+ );
125
+ runners = (0, import_sync.generateRunner)(hooksList, currentHooks);
82
126
  return runners;
83
- };
84
- const run = cb => cb();
127
+ });
128
+ const run = (cb) => cb();
85
129
  const manager = {
86
130
  createPlugin,
87
131
  isPlugin,
@@ -97,4 +141,7 @@ const createAsyncManager = (hooks, api) => {
97
141
  };
98
142
  return clone();
99
143
  };
100
- exports.createAsyncManager = createAsyncManager;
144
+ // Annotate the CommonJS export names for ESM import in node:
145
+ 0 && (module.exports = {
146
+ createAsyncManager
147
+ });
@@ -1,38 +1,19 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _sync = require("./sync");
7
- Object.keys(_sync).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _sync[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _sync[key];
14
- }
15
- });
16
- });
17
- var _async = require("./async");
18
- Object.keys(_async).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _async[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _async[key];
25
- }
26
- });
27
- });
28
- var _types = require("./types");
29
- Object.keys(_types).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _types[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _types[key];
36
- }
37
- });
38
- });
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var manager_exports = {};
16
+ module.exports = __toCommonJS(manager_exports);
17
+ __reExport(manager_exports, require("./sync"), module.exports);
18
+ __reExport(manager_exports, require("./async"), module.exports);
19
+ __reExport(manager_exports, require("./types"), module.exports);
@@ -1,35 +1,60 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var shared_exports = {};
19
+ __export(shared_exports, {
20
+ checkPlugins: () => checkPlugins,
21
+ hasOwnProperty: () => hasOwnProperty,
22
+ includePlugin: () => includePlugin,
23
+ isObject: () => isObject,
24
+ sortPlugins: () => sortPlugins
5
25
  });
6
- exports.isObject = exports.includePlugin = exports.hasOwnProperty = exports.checkPlugins = void 0;
7
- exports.sortPlugins = sortPlugins;
8
- var _pluginDagSort = require("../utils/pluginDagSort");
9
- const checkPlugins = plugins => {
10
- plugins.forEach(origin => {
11
- origin.rivals.forEach(rival => {
12
- plugins.forEach(plugin => {
26
+ module.exports = __toCommonJS(shared_exports);
27
+ var import_pluginDagSort = require("../utils/pluginDagSort");
28
+ const checkPlugins = (plugins) => {
29
+ plugins.forEach((origin) => {
30
+ origin.rivals.forEach((rival) => {
31
+ plugins.forEach((plugin) => {
13
32
  if (rival === plugin.name) {
14
33
  throw new Error(`${origin.name} has rival ${plugin.name}`);
15
34
  }
16
35
  });
17
36
  });
18
- origin.required.forEach(required => {
19
- if (!plugins.some(plugin => plugin.name === required)) {
20
- throw new Error(`The plugin: ${required} is required when plugin: ${origin.name} is exist.`);
37
+ origin.required.forEach((required) => {
38
+ if (!plugins.some((plugin) => plugin.name === required)) {
39
+ throw new Error(
40
+ `The plugin: ${required} is required when plugin: ${origin.name} is exist.`
41
+ );
21
42
  }
22
43
  });
23
44
  });
24
45
  };
25
- exports.checkPlugins = checkPlugins;
26
46
  function sortPlugins(input) {
27
47
  const plugins = input.slice();
28
- return (0, _pluginDagSort.dagSort)(plugins);
48
+ return (0, import_pluginDagSort.dagSort)(plugins);
29
49
  }
30
- const includePlugin = (plugins, input) => plugins.some(plugin => plugin.name === input.name);
31
- exports.includePlugin = includePlugin;
32
- const isObject = obj => obj !== null && typeof obj === 'object';
33
- exports.isObject = isObject;
50
+ const includePlugin = (plugins, input) => plugins.some((plugin) => plugin.name === input.name);
51
+ const isObject = (obj) => obj !== null && typeof obj === "object";
34
52
  const hasOwnProperty = (obj, prop) => obj.hasOwnProperty(prop);
35
- exports.hasOwnProperty = hasOwnProperty;
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
55
+ checkPlugins,
56
+ hasOwnProperty,
57
+ includePlugin,
58
+ isObject,
59
+ sortPlugins
60
+ });